/* =====================================================
   GLOBAL RESET
===================================================== */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: #0b0f14;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
                 Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #e6edf3;
    -webkit-font-smoothing: antialiased;
}

/* =====================================================
   LAYOUT
===================================================== */
.app-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.header {
    padding: 16px 24px;
    background: #0f141b;
    border-bottom: 1px solid #1c232d;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.header h1 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #c9d1d9;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #555;
}

/* =====================================================
   MAIN CONTENT
===================================================== */
.main {
    flex: 1;
    padding: 24px;
    display: flex;
    justify-content: center;
    align-items: stretch;
}

.card {
    width: 100%;
    max-width: 1100px;
    background: linear-gradient(145deg, #11161d, #0c1117);
    border: 1px solid #1f2933;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    min-height: 0;   /* allows children to shrink for scroll */
}

/* =====================================================
   TELEPROMPTER / TRANSCRIPT
   SINGLE SMOOTH SURFACE
===================================================== */
.transcript-layout {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;   /* allows history box to scroll */
}

/* HISTORY AREA (TOP 2/3) */
#history-box {
    flex: 2;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    min-height: 0;  
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    align-items: center;
    scroll-behavior: smooth;
}

.history-line {
    width: 100%;
    max-width: 850px;
    text-align: center;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 1.05rem;
    color: #c9d1d9;
    margin-bottom: 6px;
}

/* CURRENT LINE AREA (BOTTOM 1/3) */
#current-box {
    flex: 0 0 auto;           /* allow box to grow if wrapped */
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0;           /* vertical spacing */
    background: transparent;
    border: none;
    border-radius: 0;
    margin: 0;
}

#current-line {
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    max-width: 850px;
    width: 100%;
    white-space: pre-wrap;     /* wrap text dynamically */
    word-wrap: break-word;     /* wrap long words if needed */
    overflow-wrap: break-word;
    line-height: 1.4;          /* spacing between wrapped lines */
    padding: 4px 8px;          /* padding inside current line */
}

/* =====================================================
   SCROLLBAR FOR HISTORY
===================================================== */
#history-box::-webkit-scrollbar {
    width: 8px;
}

#history-box::-webkit-scrollbar-thumb {
    background: #1f6feb;
    border-radius: 4px;
}

#history-box::-webkit-scrollbar-track {
    background: transparent;
}

/* =====================================================
   BUTTONS
===================================================== */
button {
    background: linear-gradient(135deg, #1f6feb, #1158c7);
    border: none;
    padding: 12px 22px;
    border-radius: 12px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    width: 100%;
    max-width: 260px;
    letter-spacing: 0.5px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(31,111,235,0.45);
}

/* =====================================================
   INPUTS
===================================================== */
input {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid #1c232d;
    background: #0d131a;
    color: #e6edf3;
    font-size: 1rem;
    margin-bottom: 14px;
}

input:focus {
    outline: none;
    border-color: #1f6feb;
    box-shadow: 0 0 0 3px rgba(31,111,235,0.25);
}

/* =====================================================
   MOBILE
===================================================== */
@media (max-width: 768px) {
    .main {
        padding: 16px;
    }

    .card {
        padding: 16px;
    }

    #transcript-container {
        min-height: 70vh;
    }

    #current-line {
        font-size: 1.2rem;
    }
}
