html, body {
    height: 100%;
    margin: 0;
}

body {
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.footer {
    margin-top: auto;
}

a {
    text-decoration: none;
}

.error-message {
    padding: 10px;
    margin: 20px 10px;
    background-color: #ffcdd2;
    color: #c62828;
    border-radius: 4px;
    border-left: 4px solid #c62828;
}

.back-button {
    background-color: transparent;
    border: none;
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem;
    margin-bottom: 0.6rem;
    margin-top: 1rem;
    margin-left: 0.2rem;
    display: flex;
    text-decoration: none;
}

/* Base button styles - medium size by default */
.primary-button,
.secondary-button {
    padding: var(--button-md-padding);
    border: 2px solid var(--primary-color);
    border-radius: var(--button-md-border-radius);
    cursor: pointer;
    font-weight: var(--button-md-font-weight);
    font-size: var(--button-md-font-size);
    transition: all 0.2s ease-in-out;
    display: inline-flex;
    align-items: center;
    gap: var(--button-md-gap);
    text-decoration: none;
    box-sizing: border-box;
    outline: none;
    line-height: 1;
}

/* Primary button styles */
.primary-button {
    background-color: var(--primary-color);
    color: white;
}

.primary-button:hover:not(:disabled) {
    background-color: var(--primary-color-dark);
    border-color: var(--primary-color-dark);
}

.primary-button:disabled {
    background-color: color-mix(in srgb, var(--primary-color) 40%, white 60%);
    border-color: color-mix(in srgb, var(--primary-color) 40%, white 60%);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Secondary button styles */
.secondary-button {
    border: 2px solid #e5e7eb;
    background: #fff;
    color: #374151;

    &:hover:not(.disabled) {
        border-color: var(--primary-color);
        color: var(--primary-color);
        background: rgba(59, 130, 246, 0.05);
    }

    &.disabled {
        color: #9ca3af;
        cursor: not-allowed;
        opacity: 0.6;
    }
}

.primary-button.button-sm,
.secondary-button.button-sm {
    padding: var(--button-sm-padding);
    border-radius: var(--button-sm-border-radius);
    font-size: var(--button-sm-font-size);
    font-weight: var(--button-sm-font-weight);
    gap: var(--button-sm-gap);
}

.tag {
    background: var(--secondary-color);
    color: #fff;
    padding: 8px 10px;
    border-radius: 16px;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.textbox {
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: white;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;

    &:hover {
        border-color: #d1d5db;
    }

    &:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }
}

.pagination-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;

    .pagination-info {
        font-size: 0.95rem;
        color: #6b7280;
        font-weight: 500;
    }

    .pagination {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: center;

        .pagination-button {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.75rem 1rem;
            border: 2px solid #e5e7eb;
            border-radius: 8px;
            background: #fff;
            color: #374151;
            text-decoration: none;
            font-weight: 500;
            font-size: 0.9rem;
            transition: all 0.2s ease;
            min-width: fit-content;

            &:hover:not(.disabled) {
                border-color: var(--primary-color);
                color: var(--primary-color);
                background: rgba(59, 130, 246, 0.05);
            }

            &.disabled {
                color: #9ca3af;
                cursor: not-allowed;
                opacity: 0.6;
            }
        }

        .page-numbers {
            display: flex;
            align-items: center;
            gap: 0.25rem;
            margin: 0 0.5rem;
            flex-wrap: wrap;

            .page-number {
                display: flex;
                align-items: center;
                justify-content: center;
                width: 2.5rem;
                height: 2.5rem;
                border: 2px solid #e5e7eb;
                border-radius: 6px;
                background: #fff;
                color: #374151;
                text-decoration: none;
                font-weight: 500;
                font-size: 0.9rem;
                transition: all 0.2s ease;

                &:hover {
                    border-color: var(--primary-color);
                    color: var(--primary-color);
                    background: rgba(59, 130, 246, 0.05);
                }

                &.active {
                    background: var(--primary-color);
                    border-color: var(--primary-color);
                    color: white;

                    &:hover {
                        background: var(--primary-color);
                        color: white;
                    }
                }
            }

            .pagination-ellipsis {
                display: flex;
                align-items: center;
                justify-content: center;
                width: 2.5rem;
                height: 2.5rem;
                color: #9ca3af;
                font-weight: 500;
            }
        }
    }
}


@media (max-width: 1024px) {
    .pagination-container {
        margin-top: 2rem;

        .pagination {
            gap: 0.25rem;

            .pagination-button {
                padding: 0.6rem 0.8rem;
                font-size: 0.85rem;
            }

            .page-number {
                width: 2.25rem;
                height: 2.25rem;
                font-size: 0.85rem;
            }
        }
    }
}

@media (max-width: 700px) {
    .pagination {
        gap: 1rem;

        .page-numbers {
            order: -1;
            margin: 0;
        }

        .pagination-info {
            text-align: center;
            font-size: 0.9rem;
        }
    }
}
