/* ============================================
   90s VOICE RECORDER - STYLE GUIDE
   Designer: Replace color values with texture images
   ============================================ */

:root {
    /* === DEVICE DIMENSIONS === */
    --device-width: 420px;
    --device-height: 600px;
    --device-padding: 40px;
    --device-border-radius: 25px;

    /* === COLORS (Replace with textures) === */
    --device-body: #2a2a2a;
    --device-body-texture: none; /* url('design-assets/textures/device-body.png') */

    --lcd-bg: #1a3a1a;
    --lcd-texture: none; /* url('design-assets/textures/lcd-background.png') */
    --lcd-text: #7dd87d;
    --lcd-glow: rgba(125, 216, 125, 0.4);

    /* === BUTTON SIZES (Fixed dimensions) === */
    --btn-record-size: 150px;    /* Circular button */
    --btn-stop-size: 130px;      /* Circular button */
    --btn-side-width: 60px;
    --btn-side-height: 100px;

    /* === BUTTON COLORS (Replace with images) === */
    --btn-record-bg: radial-gradient(circle, #ff4444, #cc0000);
    --btn-record-texture: none; /* url('design-assets/images/btn-record.png') */

    --btn-stop-bg: radial-gradient(circle, #555, #222);
    --btn-stop-texture: none; /* url('design-assets/images/btn-stop.png') */

    --btn-side-bg: linear-gradient(180deg, #555, #333);
    --btn-side-texture: none; /* url('design-assets/images/btn-side.png') */

    /* === FONTS === */
    --font-main: 'Arial', 'Helvetica', sans-serif;
    --font-lcd: 'Courier New', 'Courier', monospace;

    /* === LCD DIMENSIONS === */
    --lcd-width: 340px;
    --lcd-height: 80px;
    --lcd-border-radius: 8px;
}

/* ============================================
   BASE RESET
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #7e22ce 100%);
    min-height: 100vh;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin: 0;
    overflow: hidden;
}

@media (max-width: 768px) {
    body {
        padding: 0;
        align-items: stretch;
    }
}

/* ============================================
   APP CONTAINER
   ============================================ */
.app-container {
    position: relative;
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

@media (max-width: 768px) {
    .app-container {
        width: 100%;
        height: 100%;
        justify-content: center;
        align-items: center;
    }
}

/* ============================================
   RECORDER DEVICE BODY
   Designer: Add texture via --device-body-texture
   ============================================ */
.recorder-device {
    width: var(--device-width);
    min-height: var(--device-height);
    background: var(--device-body);
    background-image: var(--device-body-texture);
    background-size: cover;
    background-position: center;
    border-radius: var(--device-border-radius);
    padding: var(--device-padding);
    position: relative;

    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -2px 5px rgba(0, 0, 0, 0.3);

    display: flex;
    flex-direction: column;
    gap: 25px;
    align-items: center;
}

@media (max-width: 768px) {
    .recorder-device {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        min-height: 100vh;
        justify-content: flex-start;
        padding-top: 0;
    }
}

/* ============================================
   HEADER BAR
   ============================================ */
.header-bar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.app-title {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* ============================================
   LCD DISPLAY
   Designer: Add texture via --lcd-texture
   ============================================ */
.lcd-display {
    width: var(--lcd-width);
    height: var(--lcd-height);
    background: linear-gradient(180deg, #132613 0%, #1a3a1a 50%, #0f1f0f 100%);
    background-image: var(--lcd-texture);
    background-size: cover;
    background-position: center;

    border: 3px solid #0a1a0a;
    border-radius: var(--lcd-border-radius);

    box-shadow:
        inset 0 0 30px rgba(0, 0, 0, 0.8),
        inset 0 2px 5px rgba(0, 0, 0, 0.9),
        0 0 20px rgba(125, 216, 125, 0.3),
        0 4px 15px rgba(0, 0, 0, 0.5);

    position: relative;
    overflow: hidden;
}

/* LCD glass reflection effect */
.lcd-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg,
        rgba(125, 216, 125, 0.08) 0%,
        rgba(255, 255, 255, 0.02) 30%,
        rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
    border-radius: var(--lcd-border-radius) var(--lcd-border-radius) 0 0;
}

/* LCD outer glow when recording */
.lcd-display.recording {
    animation: lcd-glow 2s ease-in-out infinite;
}

@keyframes lcd-glow {
    0%, 100% {
        box-shadow:
            inset 0 0 30px rgba(0, 0, 0, 0.8),
            inset 0 2px 5px rgba(0, 0, 0, 0.9),
            0 0 20px rgba(125, 216, 125, 0.3),
            0 4px 15px rgba(0, 0, 0, 0.5);
    }
    50% {
        box-shadow:
            inset 0 0 30px rgba(0, 0, 0, 0.8),
            inset 0 2px 5px rgba(0, 0, 0, 0.9),
            0 0 30px rgba(125, 216, 125, 0.6),
            0 4px 20px rgba(125, 216, 125, 0.3);
    }
}

/* ============================================
   BUTTONS BASE STYLES
   ============================================ */
button {
    font-family: var(--font-main);
    border: none;
    cursor: pointer;
    position: relative;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    user-select: none;
}

button:active:not(:disabled) {
    transform: translateY(3px);
}

button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

/* ============================================
   RECORD BUTTON - Green Triangle
   Designer: Replace via --btn-record-texture
   ============================================ */
.btn-record {
    width: var(--btn-record-size);
    height: var(--btn-record-size);
    border-radius: 50%;

    background: linear-gradient(135deg, #4ade80, #22c55e);
    background-image: var(--btn-record-texture);
    background-size: cover;
    background-position: center;

    color: white;
    font-size: 0;
    position: relative;

    box-shadow:
        0 8px 0 #15803d,
        0 10px 25px rgba(0, 0, 0, 0.4),
        inset 0 -2px 5px rgba(0, 0, 0, 0.3),
        inset 0 2px 5px rgba(255, 255, 255, 0.3);
}

/* Green triangle play/record symbol */
.btn-record::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-40%, -50%);
    width: 0;
    height: 0;
    border-left: 50px solid white;
    border-top: 35px solid transparent;
    border-bottom: 35px solid transparent;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.btn-record:hover:not(:disabled) {
    filter: brightness(1.15);
}

.btn-record:active:not(:disabled) {
    box-shadow:
        0 3px 0 #15803d,
        0 5px 15px rgba(0, 0, 0, 0.4),
        inset 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Recording active state - pulsing animation */
.btn-record.recording {
    animation: pulse-record 1.5s ease-in-out infinite;
}

@keyframes pulse-record {
    0%, 100% {
        box-shadow:
            0 8px 0 #15803d,
            0 10px 25px rgba(34, 197, 94, 0.4),
            0 0 0 0 rgba(74, 222, 128, 0.7),
            inset 0 -2px 5px rgba(0, 0, 0, 0.3),
            inset 0 2px 5px rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow:
            0 8px 0 #15803d,
            0 10px 25px rgba(34, 197, 94, 0.6),
            0 0 0 15px rgba(74, 222, 128, 0),
            inset 0 -2px 5px rgba(0, 0, 0, 0.3),
            inset 0 2px 5px rgba(255, 255, 255, 0.3);
    }
}

/* ============================================
   STOP BUTTON - Red Square
   Designer: Replace via --btn-stop-texture
   ============================================ */
.btn-stop {
    width: var(--btn-stop-size);
    height: var(--btn-stop-size);
    border-radius: 50%;

    background: linear-gradient(135deg, #ef4444, #dc2626);
    background-image: var(--btn-stop-texture);
    background-size: cover;
    background-position: center;

    color: white;
    font-size: 0;
    position: relative;

    box-shadow:
        0 6px 0 #7f1d1d,
        0 8px 20px rgba(0, 0, 0, 0.4),
        inset 0 -2px 5px rgba(0, 0, 0, 0.3),
        inset 0 2px 5px rgba(255, 255, 255, 0.2);
}

/* Red square stop symbol */
.btn-stop::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 45px;
    height: 45px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn-stop:hover:not(:disabled) {
    filter: brightness(1.15);
}

.btn-stop:active:not(:disabled) {
    box-shadow:
        0 2px 0 #7f1d1d,
        0 4px 12px rgba(0, 0, 0, 0.4),
        inset 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* ============================================
   TRANSCRIPT DISPLAY
   Shows live transcript as recording happens
   ============================================ */
.transcript-display {
    width: var(--lcd-width);
    max-height: 180px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    overflow-y: auto;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
}

.transcript-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.transcript-content {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    font-family: var(--font-main);
    word-wrap: break-word;
}

/* Scrollbar styling */
.transcript-display::-webkit-scrollbar {
    width: 6px;
}

.transcript-display::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.transcript-display::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.transcript-display::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* ============================================
   SIDE CONTROLS (Vertical buttons on the right)
   Designer: Replace via --btn-side-texture
   ============================================ */
.side-controls {
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn-side {
    width: var(--btn-side-width);
    height: var(--btn-side-height);
    border-radius: 8px;
    background: var(--btn-side-bg);
    background-image: var(--btn-side-texture);
    background-size: cover;
    background-position: center;

    color: white;
    font-size: 9px;

    box-shadow:
        0 4px 0 #222,
        0 6px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px;
}

.btn-side-icon {
    font-size: 22px;
    line-height: 1;
}

.btn-side-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 1px;
}

.btn-side:hover {
    filter: brightness(1.2);
}

.btn-side:active {
    box-shadow:
        0 2px 0 #222,
        0 4px 10px rgba(0, 0, 0, 0.3),
        inset 0 2px 5px rgba(0, 0, 0, 0.4);
}

/* ============================================
   RECORDINGS PANEL (Sidebar)
   ============================================ */
.recordings-panel {
    position: fixed;
    right: -450px;
    top: 0;
    width: 450px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.4);
    transition: right 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    padding: 30px;
    overflow-y: auto;
    z-index: 1000;
}

.recordings-panel.open {
    right: 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    :root {
        --device-width: 100%;
        --device-padding: 25px;
    }

    .app-container {
        width: 100%;
        justify-content: center;
    }

    .recordings-panel {
        width: 100%;
        right: -100%;
    }
}

/* ============================================
   USER WIDGET (In Header)
   ============================================ */
.user-widget {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 6px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.user-widget:hover {
    background: rgba(0, 0, 0, 0.5);
}

.session-status {
    color: rgba(255, 255, 255, 0.9);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

/* User icon indicator */
.user-widget::before {
    content: '👤';
    font-size: 16px;
    line-height: 1;
    display: block;
}

/* Logged in indicator - green dot */
.user-widget.logged-in::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 8px;
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.8);
}

.widget-btn {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.widget-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

/* ============================================
   PRIVACY/LOGIN MODAL
   ============================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: #fff;
    padding: 35px;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    max-width: 500px;
    width: 90%;
    text-align: center;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    color: #777;
    cursor: pointer;
    line-height: 20px;
    transition: color 0.2s;
}

.close:hover {
    color: #ff4444;
}

.modal-title {
    color: #2a9df4;
    font-weight: bold;
    font-size: 24px;
    margin-bottom: 10px;
}

.modal-intro {
    margin-bottom: 25px;
    color: #555;
    font-size: 16px;
    line-height: 1.5;
}

.disclosure-section {
    text-align: left;
    background-color: #f8f8f8;
    padding: 18px;
    margin: 15px 0;
    border-radius: 10px;
    border-left: 4px solid #2a9df4;
}

.disclosure-title {
    color: #333;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 8px;
}

.disclosure-section p {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

.disclosure-link {
    color: #2a9df4;
    text-decoration: none;
    font-weight: 600;
}

.disclosure-link:hover {
    text-decoration: underline;
}

.modal-btn-primary {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: #fff;
    padding: 14px 32px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.modal-btn-primary:hover {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

.modal-btn-primary:active {
    transform: translateY(0);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hidden {
    display: none !important;
}

.btn-label {
    display: inline-block;
    /* Designer: Set to display: none if using image buttons with baked-in text */
}
