/* ============================================
   AI Quiz Generator - RCNR AI Solutions
   Branding aligned with rcnr.ai
   ============================================ */

/* ========== CSS VARIABLES - RCNR PALETTE ========== */
:root {
    /* Core Palette - Kraken inspired */
    --deep-sea: #001628;
    --midnight: #000C17;
    --navy: #001f3f;
    --ice: #99D9D9;
    --ice-muted: #68A2B9;
    --ice-glow: rgba(153, 217, 217, 0.15);
    --ice-subtle: rgba(153, 217, 217, 0.08);
    --ice-border: rgba(153, 217, 217, 0.25);

    /* Neutrals */
    --white: #FAFAFA;
    --white-pure: #FFFFFF;
    --gray-100: #E8EAED;
    --gray-400: #9AA0A6;
    --gray-600: #5F6368;

    /* Typography */
    --font-display: 'Instrument Serif', Georgia, serif;
    --font-body: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --duration: 0.4s;
}

/* ========== RESET ========== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--deep-sea);
    color: var(--white);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   Navigation
   ============================================ */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1rem 1.5rem;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-logo {
    display: inline-block;
}

.nav-logo svg {
    height: 40px;
    width: auto;
    transition: opacity 0.3s ease;
}

.nav-logo:hover svg {
    opacity: 0.8;
}

.nav-toolbox-badge {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.75rem;
    background: rgba(153, 217, 217, 0.15);
    border: 1px solid rgba(153, 217, 217, 0.3);
    border-radius: 999px;
    color: var(--ice);
}

/* ============================================
   Header
   ============================================ */

.header {
    text-align: center;
    padding: 80px 20px 20px;
    border-bottom: 1px solid rgba(153, 217, 217, 0.1);
}

.header h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 400;
    color: var(--white);
    margin-bottom: 8px;
}

.header h1 .highlight {
    font-style: italic;
    color: var(--ice);
}

.header p {
    font-size: 0.95rem;
    color: var(--gray-400);
}

/* ============================================
   Main Chat Container
   ============================================ */

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    /* Add padding at bottom to account for sticky input */
    padding-bottom: 0;
}

/* ============================================
   Messages Area
   ============================================ */

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
    /* Add bottom padding to prevent content from being hidden behind sticky input */
    padding-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    display: flex;
    gap: 12px;
    max-width: 85%;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message.assistant {
    align-self: flex-start;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: var(--ice-glow);
    color: var(--ice);
}

.message.assistant .message-avatar {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.message-content {
    background: var(--ice-subtle);
    border-radius: 16px;
    padding: 14px 18px;
    border: 1px solid rgba(153, 217, 217, 0.1);
}

.message.user .message-content {
    background: var(--ice-glow);
    border-color: rgba(153, 217, 217, 0.25);
}

.message-text {
    color: var(--gray-100);
}

.message-attachment {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(0, 12, 23, 0.4);
    border-radius: 8px;
    font-size: 0.9em;
    color: var(--gray-400);
}

.message-attachment-icon {
    color: var(--ice);
}

/* ============================================
   Welcome Message
   ============================================ */

.welcome-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-400);
}

.welcome-message h2 {
    font-family: var(--font-display);
    color: var(--white);
    font-weight: 400;
    font-size: 1.75rem;
    margin-bottom: 12px;
}

.welcome-message p {
    margin-bottom: 20px;
}

/* ============================================
   Input Hints
   ============================================ */

.input-hints {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 16px;
}

.hint-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--ice-subtle);
    border: 1px solid rgba(153, 217, 217, 0.15);
    border-radius: 20px;
    font-size: 0.85em;
    color: var(--gray-400);
    transition: all 0.3s var(--ease-out);
}

.hint-chip:hover {
    background: var(--ice-glow);
    border-color: rgba(153, 217, 217, 0.3);
}

.hint-chip-icon {
    color: var(--ice);
}

/* ============================================
   Questions Preview in Chat
   ============================================ */

.questions-preview {
    margin-top: 12px;
}

.question-card {
    background: rgba(0, 12, 23, 0.4);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid rgba(153, 217, 217, 0.1);
}

.question-card:last-child {
    margin-bottom: 0;
}

.question-text {
    font-weight: 500;
    margin-bottom: 12px;
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    transition: background 0.2s ease;
    padding: 8px;
    margin: -8px -8px 12px -8px;
    border-radius: 6px;
}

.question-text:hover {
    background: rgba(153, 217, 217, 0.1);
}

.question-text-content {
    flex: 1;
}

.question-number {
    font-weight: 600;
    color: var(--ice);
    white-space: nowrap;
}

.answer {
    padding: 8px 12px;
    margin: 6px 0;
    border-radius: 6px;
    background: var(--ice-subtle);
    border: 1px solid rgba(153, 217, 217, 0.1);
    color: var(--gray-400);
    font-size: 0.95em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s ease;
}

.answer:hover {
    background: rgba(153, 217, 217, 0.12);
}

.answer.correct {
    background: var(--ice-glow);
    border-color: var(--ice);
}

.answer.correct:hover {
    background: rgba(153, 217, 217, 0.2);
}

.answer-label {
    font-weight: 600;
    color: var(--ice);
    margin-right: 0;
}

.answer-letter {
    font-weight: 500;
    color: var(--ice-muted);
    white-space: nowrap;
}

.answer-text-content {
    flex: 1;
}

/* Edit icon (pencil) */
.edit-icon {
    opacity: 0;
    color: var(--ice-muted);
    font-size: 0.85em;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.question-text:hover .edit-icon,
.answer:hover .edit-icon {
    opacity: 1;
}

/* Inline edit input */
.edit-input {
    flex: 1;
    padding: 6px 10px;
    background: rgba(0, 12, 23, 0.8);
    border: 1px solid var(--ice);
    border-radius: 4px;
    color: var(--white);
    font-size: inherit;
    font-family: var(--font-body);
    outline: none;
}

.edit-input:focus {
    box-shadow: 0 0 0 2px rgba(153, 217, 217, 0.2);
}

.edit-save-btn {
    padding: 4px 12px;
    font-size: 0.8em;
    background: var(--ice);
    color: var(--deep-sea);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
}

.edit-save-btn:hover {
    background: var(--white-pure);
    transform: none;
}

.question-meta {
    margin-top: 10px;
    font-size: 0.85em;
    color: var(--gray-600);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.question-meta span {
    margin-right: 8px;
}

.question-type-badge {
    background: rgba(153, 217, 217, 0.15);
    color: var(--ice);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 500;
}

/* ============================================
   QTI Question Type Styles
   ============================================ */

.answer-hint {
    font-size: 0.85em;
    color: var(--gray-500);
    margin-bottom: 8px;
    font-style: italic;
}

.answer-label-empty {
    color: var(--gray-600);
    margin-right: 6px;
}

/* Short Answer / Fill in Blank */
.short-answer-preview {
    margin-top: 8px;
}

.accepted-answers {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.accepted-answer {
    background: var(--ice-glow);
    border: 1px solid var(--ice);
    color: var(--white);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.9em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s ease;
}

.accepted-answer:hover {
    background: rgba(153, 217, 217, 0.2);
}

.accepted-answer .edit-icon {
    opacity: 0;
    font-size: 0.8em;
}

.accepted-answer:hover .edit-icon {
    opacity: 1;
}

.add-answer-btn {
    background: transparent;
    border: 1px dashed var(--gray-600);
    color: var(--gray-500);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-answer-btn:hover {
    border-color: var(--ice);
    color: var(--ice);
}

/* Matching Questions */
.matching-preview {
    margin-top: 8px;
}

.matching-pairs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.matching-pair {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--ice-subtle);
    border: 1px solid rgba(153, 217, 217, 0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.matching-pair:hover {
    background: rgba(153, 217, 217, 0.12);
}

.match-left {
    flex: 1;
    color: var(--white);
    font-weight: 500;
}

.match-arrow {
    color: var(--ice);
    font-size: 1.2em;
}

.match-right {
    flex: 1;
    color: var(--ice);
}

.matching-pair .edit-icon {
    opacity: 0;
    color: var(--ice-muted);
}

.matching-pair:hover .edit-icon {
    opacity: 1;
}

.distractors {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.distractor-label {
    font-size: 0.85em;
    color: var(--gray-500);
}

.distractor {
    background: rgba(255, 100, 100, 0.1);
    border: 1px solid rgba(255, 100, 100, 0.3);
    color: var(--gray-400);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85em;
}

/* Essay Questions */
.essay-preview {
    margin-top: 8px;
}

.essay-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(153, 217, 217, 0.05);
    border: 1px dashed rgba(153, 217, 217, 0.3);
    border-radius: 8px;
    color: var(--gray-400);
    font-size: 0.9em;
}

.essay-icon {
    font-size: 1.3em;
}

/* Numerical Questions */
.numerical-preview {
    margin-top: 8px;
    cursor: pointer;
}

.numerical-answer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--ice-glow);
    border: 1px solid var(--ice);
    border-radius: 6px;
    transition: background 0.2s ease;
}

.numerical-preview:hover .numerical-answer {
    background: rgba(153, 217, 217, 0.2);
}

.numerical-value {
    color: var(--white);
    font-weight: 600;
    font-size: 1.1em;
}

.numerical-tolerance {
    color: var(--ice-muted);
    font-size: 0.9em;
}

.numerical-answer .edit-icon {
    opacity: 0;
}

.numerical-preview:hover .edit-icon {
    opacity: 1;
}

/* ============================================
   Export Bar in Chat
   ============================================ */

.export-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(153, 217, 217, 0.1);
}

.export-bar label {
    color: var(--gray-400);
    font-size: 0.9em;
}

.export-bar select {
    padding: 10px 14px;
    background: rgba(0, 12, 23, 0.6);
    border: 1px solid rgba(153, 217, 217, 0.2);
    border-radius: 8px;
    color: var(--gray-100);
    font-size: 0.95em;
    font-family: var(--font-body);
}

.export-bar select:focus {
    outline: none;
    border-color: var(--ice);
}

.export-bar select option {
    background: var(--midnight);
}

/* ============================================
   Input Area - Sticky at bottom
   ============================================ */

.input-area {
    position: sticky;
    bottom: 0;
    padding: 20px 0;
    border-top: 1px solid rgba(153, 217, 217, 0.1);
    background: var(--deep-sea);
    /* Gradient fade at top for smooth transition */
    background: linear-gradient(to bottom,
        rgba(0, 22, 40, 0) 0%,
        var(--deep-sea) 15px,
        var(--deep-sea) 100%);
    padding-top: 30px;
    margin-top: -10px;
    z-index: 10;
}

/* ============================================
   Attachment Preview
   ============================================ */

.attachment-preview {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    margin-bottom: 12px;
    background: var(--ice-glow);
    border: 1px solid rgba(153, 217, 217, 0.2);
    border-radius: 10px;
}

.attachment-preview.active {
    display: flex;
}

.attachment-preview-icon {
    color: var(--ice);
    font-size: 1.2em;
}

.attachment-preview-info {
    flex: 1;
}

.attachment-preview-name {
    font-weight: 500;
    color: var(--white);
    font-size: 0.95em;
}

.attachment-preview-meta {
    font-size: 0.8em;
    color: var(--gray-600);
}

.attachment-preview-remove {
    background: none;
    border: none;
    color: var(--gray-600);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 1.1em;
    border-radius: 4px;
}

.attachment-preview-remove:hover {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    transform: none;
    box-shadow: none;
}

/* ============================================
   Input Row
   ============================================ */

.input-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.input-wrapper {
    flex: 1;
    position: relative;
}

.chat-input {
    width: 100%;
    padding: 16px 50px 16px 18px;
    background: rgba(0, 12, 23, 0.6);
    border: 1px solid rgba(153, 217, 217, 0.2);
    border-radius: 12px;
    font-size: 1em;
    font-family: var(--font-body);
    color: var(--gray-100);
    resize: none;
    min-height: 56px;
    max-height: 150px;
    transition: all 0.3s var(--ease-out);
}

.chat-input:focus {
    outline: none;
    border-color: var(--ice);
    background: rgba(0, 12, 23, 0.8);
    box-shadow: 0 0 0 3px rgba(153, 217, 217, 0.1);
}

.chat-input::placeholder {
    color: var(--gray-600);
}

/* ============================================
   Attachment Button
   ============================================ */

.attach-btn {
    position: absolute;
    right: 12px;
    bottom: 12px;
    background: none;
    border: none;
    color: var(--gray-600);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    font-size: 1.3em;
    transition: all 0.2s var(--ease-out);
}

.attach-btn:hover {
    color: var(--ice);
    background: var(--ice-subtle);
    transform: none;
    box-shadow: none;
}

/* Hidden file input */
#fileInput {
    display: none;
}

/* ============================================
   Send Button
   ============================================ */

.send-btn {
    background: var(--ice);
    color: var(--deep-sea);
    border: none;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    display: flex;
    align-items: center;
    gap: 8px;
}

.send-btn:hover {
    background: var(--white-pure);
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(153, 217, 217, 0.3);
}

.send-btn:disabled {
    background: var(--gray-600);
    color: var(--gray-400);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ============================================
   Settings Row
   ============================================ */

.settings-row {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.setting-item label {
    font-size: 0.85em;
    color: var(--gray-600);
    text-transform: none;
    letter-spacing: normal;
    margin-bottom: 0;
}

.setting-item input,
.setting-item select {
    padding: 8px 12px;
    background: rgba(0, 12, 23, 0.6);
    border: 1px solid rgba(153, 217, 217, 0.2);
    border-radius: 8px;
    color: var(--gray-100);
    font-size: 0.9em;
    font-family: var(--font-body);
}

.setting-item input:focus,
.setting-item select:focus {
    outline: none;
    border-color: var(--ice);
}

.setting-item select option {
    background: var(--midnight);
}

.setting-item input[type="number"] {
    width: 70px;
}

/* ============================================
   Action Buttons
   ============================================ */

button {
    background: var(--ice);
    color: var(--deep-sea);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
}

button:hover {
    background: var(--white-pure);
    transform: translateY(-1px);
}

button:disabled {
    background: var(--gray-600);
    color: var(--gray-400);
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--ice-muted);
    color: var(--ice);
}

.btn-secondary:hover {
    background: var(--ice-glow);
    border-color: var(--ice);
}

/* ============================================
   Loading Indicator
   ============================================ */

.loading-indicator {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 20px;
    color: var(--gray-400);
}

.loading-indicator.active {
    display: flex;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(153, 217, 217, 0.1);
    border-top: 3px solid var(--ice);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   Modal
   ============================================ */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 12, 23, 0.9);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: rgba(0, 22, 40, 0.95);
    border: 1px solid rgba(153, 217, 217, 0.2);
    border-radius: 16px;
    padding: 30px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal h3 {
    font-family: var(--font-display);
    color: var(--ice);
    margin-bottom: 20px;
    font-weight: 400;
    font-size: 1.5rem;
}

.modal ol {
    margin-left: 20px;
    color: var(--gray-400);
}

.modal li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.modal a {
    color: var(--ice);
    text-decoration: none;
}

.modal a:hover {
    text-decoration: underline;
}

.modal strong {
    color: var(--white);
}

.modal-footer {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-note {
    margin-top: 20px;
    padding: 12px;
    background: var(--ice-subtle);
    border-radius: 8px;
    font-size: 0.9em;
    color: var(--gray-600);
}

/* ============================================
   Tips & Limits Section
   ============================================ */

.tips-section {
    margin-top: 16px;
}

.tips-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--ice-subtle);
    border: 1px solid rgba(153, 217, 217, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
}

.tips-toggle:hover {
    background: var(--ice-glow);
    border-color: rgba(153, 217, 217, 0.25);
    transform: none;
    box-shadow: none;
}

.tips-toggle-icon {
    font-size: 1.1em;
}

.tips-toggle-text {
    flex: 1;
    text-align: left;
    color: var(--gray-400);
    font-weight: 500;
    font-size: 0.9em;
}

.tips-toggle-arrow {
    color: var(--ice);
    font-size: 0.8em;
    transition: transform 0.3s var(--ease-out);
}

.tips-toggle-arrow.open {
    transform: rotate(180deg);
}

.tips-content {
    display: none;
    margin-top: 12px;
    padding: 16px;
    background: rgba(0, 12, 23, 0.4);
    border: 1px solid rgba(153, 217, 217, 0.1);
    border-radius: 12px;
    animation: slideDown 0.3s var(--ease-out);
}

.tips-content.open {
    display: block;
}

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

.tips-category {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(153, 217, 217, 0.1);
}

.tips-category:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.tips-category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.tips-category-icon {
    font-size: 1.2em;
}

.tips-category-title {
    font-weight: 600;
    color: var(--ice);
    font-size: 0.95em;
}

.tips-category-body {
    padding-left: 32px;
}

.tips-category-body ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tips-category-body li {
    position: relative;
    padding-left: 16px;
    margin-bottom: 8px;
    color: var(--gray-400);
    font-size: 0.9em;
    line-height: 1.5;
}

.tips-category-body li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--ice);
    font-weight: 600;
}

.tips-category-body li strong {
    color: var(--white);
}

.tips-category-body p {
    color: var(--gray-400);
    font-size: 0.9em;
    line-height: 1.5;
    margin-bottom: 12px;
}

.tips-hint {
    margin-top: 12px;
    padding: 10px 14px;
    background: var(--ice-subtle);
    border-radius: 8px;
    font-size: 0.85em !important;
    color: var(--gray-600) !important;
}

.tips-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: 600;
    margin-left: 6px;
    vertical-align: middle;
}

.tips-badge-warning {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.tips-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.tips-tag {
    display: inline-block;
    padding: 6px 12px;
    background: var(--ice-subtle);
    border: 1px solid rgba(153, 217, 217, 0.15);
    border-radius: 16px;
    font-size: 0.8em;
    color: var(--gray-100);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .logo img {
        height: 40px;
    }

    .input-hints {
        flex-direction: column;
        align-items: center;
    }

    .settings-row {
        flex-direction: column;
    }

    .export-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .input-row {
        flex-direction: column;
    }

    .send-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   Password Gate
   ============================================ */

.password-gate {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--deep-sea);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.password-gate.hidden {
    display: none;
}

.password-modal {
    background: rgba(0, 22, 40, 0.95);
    border: 1px solid rgba(153, 217, 217, 0.2);
    border-radius: 20px;
    padding: 40px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.password-header {
    margin-bottom: 30px;
}

.password-logo {
    margin-bottom: 24px;
}

.password-logo img {
    height: 80px;
    width: auto;
}

.password-header h2 {
    font-family: var(--font-display);
    color: var(--ice);
    font-weight: 400;
    font-size: 1.75rem;
    margin-bottom: 8px;
}

.password-header p {
    color: var(--gray-400);
    font-size: 0.95em;
}

.password-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.password-form input {
    width: 100%;
    padding: 16px 20px;
    background: rgba(0, 12, 23, 0.6);
    border: 1px solid rgba(153, 217, 217, 0.2);
    border-radius: 8px;
    font-size: 1em;
    font-family: var(--font-body);
    color: var(--gray-100);
    text-align: center;
    letter-spacing: 0.1em;
    transition: all 0.3s var(--ease-out);
}

.password-form input:focus {
    outline: none;
    border-color: var(--ice);
    background: rgba(0, 12, 23, 0.8);
    box-shadow: 0 0 0 3px rgba(153, 217, 217, 0.1);
}

.password-form input::placeholder {
    color: var(--gray-600);
    letter-spacing: normal;
}

.password-form button {
    width: 100%;
    padding: 16px 24px;
    background: var(--ice);
    color: var(--deep-sea);
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
}

.password-form button:hover {
    background: var(--white-pure);
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(153, 217, 217, 0.3);
}

.password-error {
    color: #ff6b6b;
    font-size: 0.9em;
    margin-top: 12px;
    min-height: 20px;
}

/* ============================================
   RCNR Footer
   ============================================ */

.rcnr-footer {
    padding: 1rem 1.5rem;
    text-align: center;
    border-top: 1px solid var(--ice-border);
    background: rgba(0, 12, 23, 0.5);
    margin-top: auto;
}

.rcnr-footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--gray-600);
    font-size: 0.8rem;
}

.rcnr-footer-logo {
    height: 16px;
    width: auto;
    opacity: 0.5;
}

.rcnr-footer a {
    color: var(--gray-400);
    text-decoration: none;
    transition: color 0.3s;
}

.rcnr-footer a:hover {
    color: var(--ice);
}

/* ============================================
   Export Format Required Styling
   ============================================ */

.format-required:invalid,
.format-required option[value=""] {
    color: var(--gray-500);
}

/* Highlight animation when format not selected */
.highlight-required {
    animation: pulseHighlight 0.5s ease-in-out 3;
    border-color: #ffc107 !important;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.2) !important;
}

@keyframes pulseHighlight {
    0%, 100% {
        border-color: #ffc107;
        box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.2);
    }
    50% {
        border-color: #ff9800;
        box-shadow: 0 0 0 5px rgba(255, 193, 7, 0.3);
    }
}


/* ============================================
   Convert Only Toggle
   ============================================ */

.convert-toggle {
    margin-left: auto;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--ice);
    cursor: pointer;
}

.toggle-text {
    font-size: 0.85em;
    color: var(--gray-400);
    transition: color 0.2s ease;
}

.toggle-label:hover .toggle-text {
    color: var(--ice);
}

.toggle-label input[type="checkbox"]:checked + .toggle-text {
    color: var(--ice);
    font-weight: 500;
}