/* ===================================
   DESIGN SYSTEM - Minimalist Theme
   =================================== */

:root {
    /* Colors - Neutral Palette */
    --color-background: #fafafa;
    --color-foreground: #0a0a0a;
    --color-muted: #f5f5f5;
    --color-muted-foreground: #737373;
    --color-border: #e5e5e5;
    --color-accent: #18181b;
    --color-accent-foreground: #fafafa;
    --color-primary: #3b82f6;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

/* ===================================
   GLOBAL STYLES
   =================================== */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-background);
    color: var(--color-foreground);
    padding: 20px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===================================
   INDEX PAGE STYLES
   =================================== */

.container {
    background: white;
    padding: var(--space-2xl);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    max-width: 700px;
    width: 100%;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: var(--space-2xl);
    padding-bottom: var(--space-xl);
    border-bottom: 1px solid var(--color-border);
}

.header-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-sm);
    opacity: 0.9;
}

h1 {
    color: var(--color-foreground);
    margin-bottom: var(--space-sm);
    font-size: 1.875rem;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.subtitle {
    color: var(--color-muted-foreground);
    margin-bottom: 0;
    font-size: 0.875rem;
    font-weight: 400;
}

/* Question Form */
.question-form {
    margin-bottom: var(--space-2xl);
}

/* Textarea Wrapper */
.textarea-wrapper {
    position: relative;
    margin-bottom: 15px;
}

textarea {
    width: 100%;
    padding: var(--space-md);
    padding-bottom: 2.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-family: inherit;
    background: var(--color-background);
    transition: all 0.2s ease;
    resize: vertical;
}

textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    background: white;
    box-shadow: var(--shadow-sm);
}

/* Character Counter */
.char-counter {
    position: absolute;
    bottom: 10px;
    right: 15px;
    font-size: 0.85em;
    color: #999;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 8px;
    border-radius: 4px;
    transition: color 0.3s ease, font-weight 0.3s ease;
    pointer-events: none;
}

.char-counter.warning {
    color: var(--color-warning);
    font-weight: 600;
}

.char-counter.danger {
    color: var(--color-danger);
    font-weight: 700;
}

.submit-btn {
    width: 100%;
    padding: var(--space-md);
    background: var(--color-accent);
    color: var(--color-accent-foreground);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
}

.submit-btn:hover:not(:disabled) {
    background: var(--color-foreground);
    box-shadow: var(--shadow-md);
}

.submit-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.submit-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Button States */
.submit-btn .btn-text,
.submit-btn .btn-loader,
.submit-btn .btn-success {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.submit-btn.loading .btn-text { display: none; }
.submit-btn.loading .btn-loader { display: flex; }
.submit-btn.loading .btn-success { display: none; }

.submit-btn.success .btn-text { display: none; }
.submit-btn.success .btn-loader { display: none; }
.submit-btn.success .btn-success { display: flex; }

.submit-btn:not(.loading):not(.success) .btn-loader,
.submit-btn:not(.loading):not(.success) .btn-success {
    display: none;
}

.submit-btn.success {
    background: var(--color-success);
}

/* Spinner Animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Success Checkmark Animation */
@keyframes checkmark {
    0% { transform: scale(0) rotate(0deg); }
    50% { transform: scale(1.2) rotate(180deg); }
    100% { transform: scale(1) rotate(360deg); }
}

.btn-success {
    animation: checkmark 0.4s ease;
}

/* Turnstile Widget */
.turnstile-hidden {
    display: none;
    margin-bottom: 15px;
}

/* Questions Section */
.questions-section h2 {
    color: var(--color-foreground);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.questions-section h2::before {
    content: "💬";
    font-size: 1.25rem;
}

.questions-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.loading {
    text-align: center;
    color: var(--color-muted-foreground);
    font-style: italic;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-muted-foreground);
}

.empty-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--color-foreground);
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--color-muted-foreground);
    margin-bottom: 25px;
    font-style: normal;
}

.empty-cta {
    background: var(--color-accent);
    color: white;
    border: none;
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.empty-cta:hover {
    background: var(--color-foreground);
    box-shadow: var(--shadow-md);
}

.empty-cta:active {
    transform: scale(0.98);
}

/* Question Card */
.question-card {
    display: flex;
    gap: var(--space-lg);
    background: white;
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    transition: all 0.2s ease;
    animation: fadeIn 0.3s ease;
}

.question-card:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-sm);
}

/* Top Question (most votes) */
.question-card.top-question {
    background: var(--color-muted);
    border: 1px solid var(--color-accent);
    position: relative;
}

.question-card.top-question::before {
    content: "👑";
    position: absolute;
    top: -8px;
    left: var(--space-md);
    background: var(--color-accent);
    color: white;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
}

.question-card.top-question .vote-count {
    font-size: 1.5em;
    color: var(--color-accent);
}

.question-card.top-question:hover {
    box-shadow: var(--shadow-md);
}

/* High Vote Questions (top 25%) */
.question-card.high-votes {
    border-left: 2px solid var(--color-primary);
    background: white;
}

.question-card.high-votes .vote-count {
    color: var(--color-primary);
    font-size: 1.25em;
}

/* Trending (recently gaining votes) */
.question-card.trending {
    position: relative;
    background: white;
    border-color: var(--color-warning);
}

.question-card.trending::after {
    content: "🔥";
    position: absolute;
    top: -8px;
    right: var(--space-md);
    background: var(--color-warning);
    color: white;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

.vote-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 60px;
}

.vote-btn {
    background: var(--color-muted);
    color: var(--color-muted-foreground);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    width: 44px;
    height: 44px;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vote-btn:hover:not(:disabled) {
    background: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
}

.vote-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.vote-btn:disabled {
    cursor: not-allowed;
}

.vote-btn.voted {
    background: var(--color-success);
    color: white;
    border-color: var(--color-success);
}

.vote-btn.voted:hover {
    background: var(--color-success);
    border-color: var(--color-success);
}

/* Vote Success Animation */
@keyframes voteSuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.vote-btn.animating {
    animation: voteSuccess 0.4s ease;
}

.vote-count.pulse {
    animation: voteSuccess 0.5s ease;
}

.vote-count {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-foreground);
}

.question-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.question-text {
    font-size: 0.9375rem;
    color: var(--color-foreground);
    line-height: 1.6;
}

.question-meta {
    font-size: 0.75rem;
    color: var(--color-muted-foreground);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-sm);
}

.report-btn {
    background: none;
    border: none;
    color: var(--color-muted-foreground);
    font-size: 0.85em;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.report-btn:hover {
    background: var(--color-muted);
    color: var(--color-danger);
}

/* Own Question Badge */
.own-badge {
    background: var(--color-accent);
    color: white;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    margin: 0 var(--space-xs);
}

/* Question Actions (Edit/Delete) */
.question-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--color-border);
}

.edit-btn,
.delete-btn {
    background: none;
    border: 1px solid var(--color-border);
    color: var(--color-muted-foreground);
    font-size: 0.75rem;
    cursor: pointer;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.edit-btn:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.delete-btn:hover {
    background: var(--color-danger);
    color: white;
    border-color: var(--color-danger);
}

/* Highlight own questions */
.question-card.own-question {
    border-color: var(--color-primary);
    background: var(--color-muted);
}

/* Privacy Notice on Index Page */
.privacy-notice {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
    text-align: center;
}

.privacy-notice small {
    color: var(--color-muted-foreground);
    font-size: 0.85em;
}

.privacy-notice a {
    color: var(--color-primary);
    text-decoration: none;
}

.privacy-notice a:hover {
    text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   PRIVACY PAGE STYLES
   =================================== */

/* Override body styles for privacy page */
body.privacy-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--color-background);
    color: var(--color-foreground);
    margin: 0;
    padding: 0;
    display: block;
    min-height: auto;
}

.privacy-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    text-align: left !important;
}

.privacy-content {
    background: white;
    padding: 40px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    text-align: left !important;
}

.privacy-content * {
    text-align: left !important;
}

.privacy-content h1 {
    color: var(--color-foreground);
    font-size: 2.2em;
    font-weight: 600;
    margin-bottom: 10px;
    text-align: left !important;
}

.privacy-content h2 {
    color: var(--color-foreground);
    margin-top: 30px;
    font-size: 1.4em;
    font-weight: 600;
    border-bottom: 2px solid var(--color-accent);
    padding-bottom: 8px;
    text-align: left !important;
}

.privacy-content p,
.privacy-content li {
    color: var(--color-foreground);
    line-height: 1.8;
    margin-bottom: 12px;
    text-align: left !important;
}

.privacy-content ul {
    margin-left: 25px;
    margin-bottom: 20px;
    text-align: left !important;
}

.privacy-content .highlight {
    background: var(--color-muted);
    padding: 15px;
    border-left: 4px solid var(--color-primary);
    margin: 25px 0;
    text-align: left !important;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

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

.last-updated {
    color: var(--color-muted-foreground);
    font-style: italic;
    margin-bottom: 20px;
    text-align: left !important;
}
