@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

body {
    font-family: 'Inter', sans-serif;
    background-color: #f9fafb;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

main {
    flex: 1;
}

.container {
    max-width: 100%;
    box-sizing: border-box;
}

.navbar {
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

    .navbar.scrolled {
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

.flashcard {
    perspective: 1000px;
    width: 100%;
    max-width: 600px;
    height: 350px;
    margin: 2rem auto;
    position: relative;
}

.card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    transform-origin: center center;
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    backface-visibility: hidden;
    font-size: 1.75rem;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow-y: auto;
    overflow-wrap: break-word;
    padding: 1.5rem;
    text-align: center;
    box-sizing: border-box;
    top: 0;
}

.card-front {
    position: relative;
}

    .card-front .word {
        font-size: 1.75rem;
        font-weight: 600;
        color: #1f2937;
        display: inline-block;
    }

    .card-front .speaker {
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
        cursor: pointer;
        color: #6366f1;
        font-size: 1.25rem;
        transition: color 0.3s ease;
    }

        .card-front .speaker:hover {
            color: #4f46e5;
        }

.card-back {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: white;
    transform: rotateY(180deg);
}

    .card-back span {
        display: inline-block;
        max-width: 90%;
    }

.flashcard.flipped .card-inner {
    transform: rotateY(180deg);
}

.flashcard:hover .card-inner {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.btn {
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    color: white;
}

.btn-primary {
    background: #6366f1;
}

    .btn-primary:hover {
        background: #4f46e5;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    }

.btn-outline-secondary {
    border: 1px solid #d1d5db;
    color: #4b5563;
    background: #ffffff;
}

    .btn-outline-secondary:hover {
        background: #f3f4f6;
        border-color: #6366f1;
        color: #6366f1;
        transform: translateY(-2px);
    }

.btn-success {
    background: #22c55e;
}

    .btn-success:hover {
        background: #16a34a;
        transform: translateY(-2px);
    }

.btn-warning {
    background: #f59e0b;
}

    .btn-warning:hover {
        background: #d97706;
        transform: translateY(-2px);
    }

.btn-info {
    background: #0ea5e9;
}

    .btn-info:hover {
        background: #0284c7;
        transform: translateY(-2px);
    }

.btn-danger {
    background: #ef4444;
}

    .btn-danger:hover {
        background: #b91c1c;
        transform: translateY(-2px);
    }

.btn-secondary {
    background: #6b7280;
}

    .btn-secondary:hover {
        background: #4b5563;
        transform: translateY(-2px);
    }

.navigation-buttons {
    margin-top: 1.5rem;
}

.word-list {
    background: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-top: 2.5rem;
    max-width: 100%;
    box-sizing: border-box;
}

.list-group-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 1rem 1.5rem;
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    background: #f9fafb;
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
    gap: 1rem;
    max-width: 100%;
    box-sizing: border-box;
}

    .list-group-item:hover {
        background: #eef2ff;
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    }

    .list-group-item .word {
        font-weight: 600;
        color: #1f2937;
        font-size: 1.1rem;
        max-width: 60%;
        overflow-wrap: break-word;
        flex: 1;
    }

    .list-group-item .meaning {
        color: #4b5563;
        font-size: 1rem;
        flex: 1;
        text-align: right;
    }

@media (max-width: 640px) {
    .list-group-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

        .list-group-item .word {
            max-width: 100%;
        }

        .list-group-item .meaning {
            text-align: left;
        }

    .card-front {
        flex-direction: column;
        gap: 0.3rem;
    }

        .card-front .word {
            font-size: 1.5rem;
        }

    .card-back {
        font-size: 1.25rem;
    }
}

.ad-placeholder {
    background: linear-gradient(135deg, #e5e7eb, #d1d5db);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    color: #4b5563;
    transition: transform 0.3s ease;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    margin: 2rem auto;
    box-sizing: border-box;
}

    .ad-placeholder:hover {
        transform: translateY(-5px);
    }

    .ad-placeholder ins {
        width: 100% !important;
        max-height: 280px;
    }

footer a {
    color: #d1d5db;
    transition: color 0.3s ease;
}

    footer a:hover {
        color: #6366f1;
    }
