/*
 * Anubot - Romantic Quote App
 * Elegant design with seasonal themes
 */

/* === FONTS === */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;1,400&family=Crimson+Pro:ital,wght@0,400;0,600;1,400&family=Lora:ital,wght@0,400;0,600;1,400&display=swap');

/* ============================================
   DEFAULT THEME
   Elegant teal with coral accents
   ============================================ */

:root {
    /* Background - deep teal/forest green */
    --color-bg-start: #3a4a4a;
    --color-bg-end: #2d3d3d;

    /* Cards - subtle glass effect */
    --color-card: rgba(255, 255, 255, 0.06);
    --color-card-solid: #445454;
    --color-card-border: rgba(255, 255, 255, 0.1);

    /* Accent - warm coral/salmon */
    --color-accent: #c9786a;
    --color-accent-light: #d4948a;
    --color-accent-dark: #b56a5c;

    /* Warm tones - beige/gold */
    --color-warm: #c4a882;
    --color-warm-light: #d4c4a8;

    /* Text - warm cream tones */
    --color-text: #f5f0e8;
    --color-text-light: #e0dcd4;
    --color-text-muted: #9aaeae;

    /* Borders */
    --color-border: rgba(255, 255, 255, 0.12);

    /* Typography */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Lora', Georgia, serif;

    /* Shadows */
    --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.25);
    --shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.35);
}

/* ============================================
   BASE STYLES
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 18px;
}

body {
    font-family: var(--font-body);
    background: linear-gradient(165deg, var(--color-bg-start) 0%, var(--color-bg-end) 100%);
    background-attachment: fixed;
    color: var(--color-text);
    min-height: 100vh;
    min-height: 100dvh;
    line-height: 1.7;
    padding-bottom: 90px;
    -webkit-font-smoothing: antialiased;
    transition: background 0.5s ease, color 0.3s ease;
}

/* ============================================
   CONTAINER
   ============================================ */

.container {
    max-width: 540px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem;
    position: relative;
    z-index: 1;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: -0.02em;
    transition: color 0.3s ease;
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.6rem; margin-bottom: 0.75rem; }

/* ============================================
   QUOTE CARD
   ============================================ */

.quote-card {
    background: var(--color-card);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-soft);
    position: relative;
    margin: 1.5rem 0;
    text-align: center;
    border: 1px solid var(--color-card-border);
    backdrop-filter: blur(10px);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.quote-card::before {
    content: '"';
    font-family: var(--font-display);
    font-size: 5rem;
    color: var(--color-accent-light);
    position: absolute;
    top: -0.1em;
    left: 0.3em;
    opacity: 0.2;
    line-height: 1;
    transition: color 0.3s ease;
}

.quote-text {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-style: italic;
    color: var(--color-text);
    line-height: 1.9;
    position: relative;
    z-index: 1;
    white-space: pre-line;
    transition: color 0.3s ease;
}

.quote-meta {
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.quote-image {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-block;
    padding: 0.85rem 2rem;
    border-radius: 10px;
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: var(--color-accent);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    background: var(--color-accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-love {
    background: linear-gradient(135deg, var(--color-accent), var(--color-warm));
    color: white;
    font-size: 1.2rem;
    padding: 1.1rem 3rem;
    border-radius: 12px;
    font-family: var(--font-display);
    letter-spacing: 0.02em;
}

.btn-love:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--color-text);
    border: 2px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-card);
    border-color: var(--color-accent-light);
}

.btn-warm {
    background: var(--color-warm);
    color: white;
}

/* ============================================
   FORMS
   ============================================ */

.form-group { margin-bottom: 1.25rem; }

.form-label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: var(--color-text);
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 0.85rem 1.1rem;
    border: 2px solid var(--color-border);
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 1rem;
    background: var(--color-card);
    color: var(--color-text);
    transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-border);
}

.form-input::placeholder { color: var(--color-text-muted); }

textarea.form-input {
    min-height: 120px;
    resize: vertical;
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 85vh;
    min-height: 85dvh;
    text-align: center;
    padding: 1rem;
}

.login-card {
    background: var(--color-card);
    padding: 3rem 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    width: 100%;
    max-width: 360px;
    border: 1px solid var(--color-card-border);
    backdrop-filter: blur(10px);
}

.login-title {
    font-size: 2rem;
    margin-bottom: 0.3rem;
}

.login-subtitle {
    color: var(--color-text-muted);
    margin-bottom: 2rem;
    font-style: italic;
    font-size: 1rem;
}

.login-heart {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    color: var(--color-warm);
}

.error-message {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    padding: 0.8rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ============================================
   NAVIGATION
   ============================================ */

.nav-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-card-solid);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0.7rem 0.5rem;
    padding-bottom: calc(0.7rem + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 100;
    border-top: 1px solid var(--color-border);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.nav-link {
    text-decoration: none;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-link:hover, .nav-link:active {
    color: var(--color-accent);
    background: rgba(255, 255, 255, 0.05);
}

.nav-love {
    color: var(--color-warm);
    font-weight: 600;
}

/* ============================================
   HISTORY LIST
   ============================================ */

.history-list { list-style: none; }

.history-item {
    background: var(--color-card);
    border-radius: 14px;
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--color-card-border);
}

.history-date {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-bottom: 0.4rem;
}

.history-quote {
    font-style: italic;
    line-height: 1.6;
    white-space: pre-line;
}

/* ============================================
   SHARE
   ============================================ */

.share-btn {
    background: none;
    border: none;
    color: var(--color-warm);
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.1rem;
    transition: transform 0.2s;
}

.share-btn:hover { transform: scale(1.15); }

.share-link {
    background: var(--color-card);
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.8rem;
    word-break: break-all;
    margin-top: 0.75rem;
    border: 1px solid var(--color-border);
    color: var(--color-accent-light);
}

a {
    color: var(--color-accent-light);
}

a:hover {
    color: var(--color-accent);
}

/* ============================================
   SHARED PAGE
   ============================================ */

.shared-container {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.shared-card {
    background: var(--color-card);
    border-radius: 20px;
    padding: 3rem 2.5rem;
    box-shadow: var(--shadow-hover);
    text-align: center;
    max-width: 500px;
    width: 100%;
    border: 1px solid var(--color-card-border);
    backdrop-filter: blur(10px);
}

.shared-badge {
    display: inline-block;
    background: var(--color-warm-light);
    color: var(--color-text);
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    margin-bottom: 1.5rem;
    letter-spacing: 0.1em;
    font-weight: 600;
}

/* ============================================
   ADMIN STYLES
   ============================================ */

body.admin-page .container {
    max-width: 900px;
}

body.admin-page .admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 768px) {
    body.admin-page .admin-grid { grid-template-columns: 1fr; }
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.admin-card {
    background: var(--color-card);
    border-radius: 14px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--color-card-border);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.admin-table th,
.admin-table td {
    padding: 0.6rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.admin-table th {
    font-weight: 600;
    color: var(--color-text);
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-priority {
    background: var(--color-warm-light);
    color: var(--color-text);
}

.badge-normal {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text-muted);
}

/* ============================================
   QUEUE
   ============================================ */

.queue-list { counter-reset: queue; }

.queue-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--color-card);
    border-radius: 12px;
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--color-card-border);
}

.queue-item.expandable {
    cursor: pointer;
    transition: background-color 0.2s;
}

.queue-item.expandable:hover,
.queue-item.expanded {
    background: rgba(255, 255, 255, 0.03);
}

.expand-icon {
    transition: transform 0.2s;
    flex-shrink: 0;
}

.queue-item::before {
    counter-increment: queue;
    content: counter(queue);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    background: var(--color-accent-light);
    color: white;
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.queue-item.is-priority::before {
    background: var(--color-warm);
}

/* ============================================
   VERSION INFO
   ============================================ */

.version-info {
    position: fixed;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    color: var(--color-text-light);
    opacity: 0.5;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 480px) {
    html { font-size: 16px; }
    .container { padding: 1.25rem 1rem; }
    .quote-card { padding: 2rem 1.5rem; border-radius: 16px; }
    .quote-card::before { font-size: 3.5rem; }
    .quote-text { font-size: 1.2rem; }
    .login-card { padding: 2.5rem 1.75rem; }
    .nav-footer { padding: 0.5rem 0.25rem; padding-bottom: calc(0.5rem + env(safe-area-inset-bottom)); }
    .nav-link { font-size: 0.75rem; padding: 0.4rem 0.5rem; }
    .btn-love { font-size: 1.1rem; padding: 1rem 2.5rem; }
    .admin-card { padding: 1rem; }
}

@media (pointer: coarse) {
    .btn { min-height: 48px; }
    .nav-link { min-height: 48px; min-width: 48px; }
    .form-input { min-height: 48px; }
}
