﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Inter",Arial,sans-serif
}

body {
    background: #f5f7fa;
    color: #222;
    transition: background .3s,color .3s;
    overflow-x: hidden;
    overflow-y: auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: #2f80ed;
    color: #fff;
}

.header-buttons {
    display: flex;
    gap: .6rem;
    align-items: center;
    flex-wrap: wrap;
}

    /* ✅ Contrast îmbunătățit */
    .header-buttons button {
        padding: .5rem 1rem;
        border: none;
        border-radius: 6px;
        background: #fff;
        color: #1b4fad; /* contrast 6.1:1 */
        font-weight: 600;
        cursor: pointer;
        transition: background .2s, color .2s, box-shadow .2s;
    }

        .header-buttons button:hover {
            background: #eaf1ff;
            color: #0f3173; /* contrast și mai bun la hover */
            box-shadow: 0 0 0 2px #1b4fad33;
        }

/* ✅ Dark Mode buttons contrast */
body.dark .header-buttons button {
    background: #2a2a2a;
    color: #e0e8ff;
}

    body.dark .header-buttons button:hover {
        background: #3a3a3a;
        color: #ffffff;
    }

main {
    display: block;
}

#intro {
    padding: 1rem 2rem;
    text-align: center;
}

    #intro h1 {
        color: #2f80ed;
        margin-bottom: .5rem;
        font-size: 1.8rem;
    }

    #intro p {
        max-width: 700px;
        margin: auto;
        font-size: 1rem;
        line-height: 1.5;
        color: #444;
    }

.container {
    display: flex;
    height: calc(100vh - 200px);
    gap: 1rem;
    padding: 1rem;
}

.subtitle-column {
    flex: 1;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.subtitle-lines {
    flex: 1;
    overflow-y: auto;
    margin-top: .5rem;
    padding-right: .5rem;
}

.subtitle-line {
    padding: .4rem 0;
    border-bottom: 1px solid #eee;
    position: relative
}

    .subtitle-line .time {
        display: block;
        font-size: .85rem;
        color: #555;
        margin-bottom: .2rem
    }

.select-btn {
    position: absolute;
    right: 0;
    top: 0;
    font-size: .8rem;
    background: #1b4fad;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: .2rem .4rem;
    cursor: pointer
}

    .select-btn:hover {
        background: #163a82
    }

/* Flashcards Popup */
#flashPopupBg {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    justify-content: center;
    align-items: center;
    z-index: 999
}

#flashPopup {
    background: #fff;
    border-radius: 10px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

    #flashPopup header {
        background: #2f80ed;
        color: #fff;
        padding: .8rem 1rem;
        font-size: 1.3rem;
        font-weight: 600;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    #flashPopup footer {
        background: #f5f5f5;
        color: #444;
        padding: .6rem;
        text-align: center;
        font-size: .9rem;
    }

    #flashPopup.dark footer {
        background: #2a2a2a;
        color: #ccc;
    }

#closeFlashcards {
    background: transparent;
    color: #fff;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
}

    #closeFlashcards:hover {
        color: #cfe1ff;
    }

.flash-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.flash-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.flashcard {
    width: 180px;
    height: 120px;
    perspective: 1000px;
    cursor: pointer;
    position: relative;
}

.flash-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform .6s;
    transform-style: preserve-3d;
}

.flashcard.flipped .flash-inner {
    transform: rotateY(180deg);
}

.flash-face {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,.1);
}

.flash-front {
    background: #2f80ed;
    color: #fff;
}

.flash-back {
    background: #fff;
    color: #222;
    border: 1px solid #ccc;
    transform: rotateY(180deg);
}

.flashcard.flipped {
    box-shadow: 0 0 10px 3px rgba(0,255,0,0.4);
}

.delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: red;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: .8rem;
    line-height: 22px;
    cursor: pointer;
    z-index: 2;
}

    .delete-btn:hover {
        background: #cc0000;
    }

/* LOGO LINK – always white */
.logo-link {
    color: white;
    text-decoration: none;
}

    .logo-link:hover {
        opacity: 0.8;
    }

/* in dark mode (if dark mode uses body.dark) */
body.dark .logo-link {
    color: white;
}


/* Popup Edit */
.popup-bg {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    justify-content: center;
    align-items: center;
    z-index: 998
}

.popup {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    max-width: 600px;
    text-align: center;
    width: 90%
}

.editable {
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: .5rem;
    min-height: 50px;
    margin: .5rem 0;
    text-align: left
}

.toolbar {
    display: flex;
    justify-content: center;
    gap: .5rem;
    margin-bottom: .5rem;
    flex-wrap: wrap
}

    .toolbar button {
        background: #eee;
        border: none;
        border-radius: 4px;
        padding: .3rem .6rem;
        cursor: pointer;
        font-weight: 500
    }

        .toolbar button:hover {
            background: #ddd
        }

mark.green {
    background-color: #9eff9e
}

body.dark {
    background: #121212;
    color: #ddd;
}

    body.dark .subtitle-column, body.dark .popup, body.dark #flashPopup {
        background: #1e1e1e;
        color: #ddd;
    }

    body.dark .toolbar button {
        background: #333;
        color: #ddd;
    }

        body.dark .toolbar button:hover {
            background: #444;
        }

    body.dark .flash-front {
        background: #1f5fd0;
    }

    body.dark .flash-back {
        background: #2a2a2a;
        color: #fff;
        border-color: #444;
    }

    body.dark #flashPopup header {
        background: #1f5fd0;
    }

    body.dark .delete-btn {
        background: #c0392b;
    }

/* --- CONTACT PAGE LAYOUT --- */
.contact-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.contact-container {
    max-width: 600px;
    width: 100%;
    background: var(--bg2);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 0 10px rgba(0,0,0,0.25);
}

    /* TITLE */
    .contact-container h2 {
        margin-top: 0;
        text-align: center;
    }

/* --- FORMULAR --- */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

    .contact-form input,
    .contact-form textarea {
        width: 100%;
        padding: 12px;
        border-radius: 8px;
        border: 1px solid #555;
        background: var(--bg1);
        color: var(--text);
        font-size: 16px;
    }

/* BUTTON */
.submit-btn {
    padding: 12px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: 0.2s ease;
}

    .submit-btn:hover {
        background: #45a049;
    }

/* --- SUCCESS MESSAGE --- */
.success-message {
    background: #27ae60;
    color: white;
    padding: 12px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: bold;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
}

/* --- ERROR VALIDATION --- */
.validation-error {
    color: #ff6b6b;
    font-size: 14px;
}



/* ✅ FIX MOBILE SCROLL ISSUE */
@media (max-width: 768px) {
    html, body {
        height: auto;
        overflow-y: auto;
        display: block;
    }

    .container {
        flex-direction: column;
        height: auto !important;
        min-height: 100%;
        gap: 1rem;
    }

    .subtitle-column {
        flex: none;
        width: 100%;
        min-height: 45vh;
    }

    .subtitle-lines {
        overflow-y: auto;
        max-height: 50vh;
        -webkit-overflow-scrolling: touch;
    }

    #flashPopup, .popup {
        max-height: 85vh;
    }
}
