/* MegaRiffa Common Styles */

:root {
    --scheme: light;
    --primary: #6c5ce7;
    --primary-hover: #5a4bd1;
    --primary-light: #e8e5f9;
    --accent: #fdcb6e;
    --accent-hover: #f0bc4e;
    --danger: #e74c3c;
    --danger-hover: #c0392b;
    --success: #2ecc71;
    --success-hover: #27ae60;
    --warning: #f39c12;

    --btn-primary: #1da75e;
    --btn-primary-hover: #3dc77e;

    --bg: #ffffff;
    --bg-hero: #000000;
    --bg-alt: #f8f9fa;
    --bg-card: #ffffff;
    --text: #2d3436;
    --text-alt: #636e72;
    --text-light: #b2bec3;
    --border: #dfe6e9;
    --border-light: #f0f0f0;
    --shadow: rgba(0,0,0,0.08);
    --shadow-hover: rgba(0,0,0,0.12);
    --header-bg: rgba(255,255,255,0.95);
    --footer-bg: #f8f9fa;
    --overlay: rgba(0,0,0,0.5);

    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 4px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --header-height: 64px;
    --max-width: 1200px;
}

[data-theme="dark"] {
    --scheme: dark;
    --primary: #a29bfe;
    --primary-hover: #8c84f7;
    --primary-light: #2d2366;
    --accent: #fdcb6e;
    --accent-hover: #f0bc4e;

    --bg: #1a1a2e;
    --bg-hero: transparent;
    --bg-alt: #16213e;
    --bg-card: #1e2a45;
    --text: #e0e0e0;
    --text-alt: #a0a0b0;
    --text-light: #6c6c80;
    --border: #2d3561;
    --border-light: #252d55;
    --shadow: rgba(0,0,0,0.3);
    --shadow-hover: rgba(0,0,0,0.4);
    --header-bg: rgba(26,26,46,0.95);
    --footer-bg: #16213e;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background 0.3s, color 0.3s;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

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

img {
    max-width: 100%;
    height: auto;
}


/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    z-index: 1000;
    transition: background 0.3s;
}

.header-actions {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 1.3rem;
}

.logo-icon {
    flex-shrink: 0;
}

.logo-text {
    color: var(--primary);
/*    background: linear-gradient(135deg, var(--primary), var(--accent));*/
/*    -webkit-background-clip: text;*/
/*    -webkit-text-fill-color: transparent;*/
/*    background-clip: text;*/
}

.nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-alt);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--text);
    background: var(--bg-alt);
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    padding-left: 12px;
    border-left: 1px solid var(--border);
}

.lang-link {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--radius-xs);
    color: var(--text-alt);
    text-decoration: none;
    transition: all 0.2s;
}

.lang-link.active {
    color: var(--primary);
    background: var(--primary-light);
}

.lang-sep {
    color: var(--border);
    font-size: 0.8rem;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
}

.menu-toggle:hover {
    background: var(--bg-alt);
}

/* Mobile Nav */
.mobile-nav {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    z-index: 999;
    flex-direction: column;
    gap: 8px;
    transform: translateY(-100%);
    transition: transform 0.3s;
}

.mobile-nav.open {
    transform: translateY(0);
}

.mobile-nav-link {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 1rem;
    text-decoration: none;
    transition: background 0.2s;
}

.mobile-nav-link:hover {
    background: var(--bg-alt);
}

.mobile-lang {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
}

/* Main Content */
.main-content {
    flex: 1;
    padding-top: var(--header-height);
    max-width: var(--max-width);
    margin: 0 auto;
    width: 100%;
    padding-left: 20px;
    padding-right: 20px;
}

/* Footer */
.footer {
    background: var(--footer-bg);
    border-top: 1px solid var(--border);
    padding: 40px 20px;
    margin-top: 60px;
    transition: background 0.3s;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 12px;
}

.footer-logo {
    flex-shrink: 0;
}

.footer-text {
    color: var(--text-alt);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.footer-copy {
    color: var(--text-light);
    font-size: 0.8rem;
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 10px;
    padding: 8px;
    color: var(--text);
    transition: all 0.3s;
}

.theme-toggle:hover {
    box-shadow: 0 4px 20px var(--shadow-hover);
    transform: scale(1.05);
}

.theme-icon-dark {
    display: none;
}

[data-theme="dark"] .theme-icon-light {
    display: none;
}

[data-theme="dark"] .theme-icon-dark {
    display: block;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

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

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

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

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

.btn-white {
    background: transparent;
    color: #fff;
    border-color: #fff;
}

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

.btn-accent {
    background: var(--accent);
    color: #2d3436;
    border-color: var(--accent);
}

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

.btn-danger {
    background: transparent;
    color: var(--primary);
    border-color: var(--danger);
}

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

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

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

.btn-action {
    margin-top: 1rem;
}

.btn-icon {
    border: none;
    background: transparent;
}

.btn-icon svg {
    fill: var(--primary);
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
    font-family: var(--font);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

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

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

.form-message {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.9rem;
    font-weight: 500;
}

.form-error {
    background: #fde8e8;
    color: var(--danger);
    border: 1px solid #f5c6c6;
}

.form-success {
    background: #e8f8ef;
    color: var(--success);
    border: 1px solid #c3e6d0;
}

.form-link {
    font-size: 0.85rem;
}

.form-options {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.form-checkbox label {
    margin-bottom: 0;
    font-weight: 400;
    font-size: 0.85rem;
}

.file-input {
    padding: 8px;
}

select.form-input {
    cursor: pointer;
}

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: 0 2px 8px var(--shadow);
}

.card:hover {
    box-shadow: 0 4px 16px var(--shadow-hover);
    transform: translateY(-2px);
}

.card-top {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.card-date {
    margin-bottom: 12px;
    font-size: 0.75rem;
}

.card-body {
    padding: 20px;
}

.card-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-badge.open {
/*    background: var(--primary-light);*/
    color: var(--primary);
}

.card-badge.drawn {
/*    background: #fef3e0;*/
/*    color: #e67e22;*/
    color: #eeaa22;
}

.card-view {
    display: block;
    width: 100%;
}

.card-image {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
}

.card-title {
    margin-top: 1rem;
    margin-bottom: 8px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}

.card-desc {
    font-size: 0.85rem;
    color: var(--text-alt);
    margin-bottom: 12px;
}

.card-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.85rem;
}

.card-info:last-of-type {
    border-bottom: none;
}

.card-label {
    color: var(--text-alt);
    font-weight: 500;
}

.card-value {
    color: var(--text);
    font-weight: 600;
}

.card-winner {
    margin-left: 1rem;
    padding: 5px;
    color: var(--text);
    font-weight: 600;
    border: 1px solid var(--text);
    border-radius: 5px;
}

.card-value.highlight {
    color: var(--primary);
    font-size: 1rem;
}

.card-highlight {
    border-color: var(--accent);
    position: relative;
}

.card-rank {
    position: absolute;
    top: 12px;
    right: 12px;
}

/* Sections */
.section {
    padding: 40px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

.section-link {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-alt);
}

.empty-state svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1rem;
    margin-bottom: 20px;
}

.empty-state.small {
    padding: 30px 20px;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-0 { color: var(--primary); /*background: var(--primary-light);*/ }
.status-1 { color: #636e72; /*background: #e8e8e8;*/ }
.status-2 { color: #e67e22; /*background: #fef3e0;*/ }
.status-3 { color: #27ae60; /*background: #e8f8ef;*/ }
.status-4 { color: #b2bec3; /*background: #f0f0f0;*/ }
.status-5 { color: #856404; /*background: #fff3cd;*/ }
.status-6 { color: #e74c3c; /*background: #fde8e8;*/ }
.status-7 { color: #95a5a6; /*background: #e8e8e8;*/ }

/* Tables */
.table-container {
    overflow-x: auto;
    margin-bottom: 24px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-light);
}

.data-table th {
    background: var(--bg-alt);
    font-weight: 600;
    color: var(--text-alt);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.data-table th.right,
.data-table td.right {
    text-align: right;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: var(--bg-alt);
}

.action-buttons {
    display: flex;
    gap: 6px;
    align-items: center;
}

.inline-form {
    display: inline;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 0 20px;
}

.page-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s;
}

.stat-card:hover {
    box-shadow: 0 2px 12px var(--shadow);
}

.stat-card svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.stat-card-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
}

.stat-card-value {
    color: var(--text);
    line-height: 1.2;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-card-label {
    margin-top: 4px;
    color: var(--text-alt);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Notifications */
.notification {
    position: fixed;
    top: calc(var(--header-height) + 16px);
    right: 20px;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 2000;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    max-width: 400px;
    box-shadow: 0 4px 20px var(--shadow-hover);
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    background: #e8f8ef;
    color: #27ae60;
    border: 1px solid #c3e6d0;
}

.notification-error {
    background: #fde8e8;
    color: #e74c3c;
    border: 1px solid #f5c6c6;
}

[data-theme="dark"] .notification-success {
    background: #1a3a2a;
    border-color: #2d6b4f;
}

[data-theme="dark"] .notification-error {
    background: #3a1a1a;
    border-color: #6b2d2d;
}

[data-theme="dark"] .form-error {
    background: #3a1a1a;
    border-color: #6b2d2d;
}

[data-theme="dark"] .form-success {
    background: #1a3a2a;
    border-color: #2d6b4f;
}

/* Auth Pages */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - var(--header-height) - 200px);
    padding: 40px 0;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 4px 24px var(--shadow);
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 12px;
}

.auth-icon {
    opacity: 0.8;
}

.auth-form {
    margin-bottom: 20px;
}

.auth-footer-text {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-alt);
}

.auth-footer-text a {
    font-weight: 600;
}

/* Form Pages */
.form-page {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}

.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px;
    width: 100%;
    max-width: 680px;
    box-shadow: 0 4px 24px var(--shadow);
}

.form-card-header {
    text-align: center;
    margin-bottom: 28px;
}

.form-card-header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 12px;
}

.form-subtitle {
    color: var(--text-alt);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* Dashboard */
.dashboard-page {
    padding: 20px 0;
}

.dashboard-section {
    margin-bottom: 32px;
}

.dashboard-section h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 16px;
}

/* Account Page */
.account-page {
    padding: 30px 0;
}

.account-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.account-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
}

.account-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.account-card-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
}

/* Tickets List */
.tickets-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ticket-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-alt);
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.ticket-item:hover {
    background: var(--border-light);
}

.ticket-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ticket-raffle {
    font-weight: 600;
    font-size: 0.9rem;
}

.ticket-number {
    font-size: 0.8rem;
    color: var(--text-alt);
}

.ticket-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ticket-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
}

/* Responsive */
@media (max-width: 900px) {
    .account-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .mobile-nav {
        display: flex;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .section-title {
        font-size: 1.2rem;
    }

    .auth-card,
    .form-card {
        padding: 24px 20px;
    }

    .page-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding-left: 12px;
        padding-right: 12px;
    }

    .hero-title {
        font-size: 1.8rem;
    }
}

input[type="date"],
input[type="time"],
input[type="datetime"],
input[type="datetime-local"] {
  color-scheme: var(--scheme);
}

.forgot {
    margin-top: 1rem;
}

.terms {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.7rem;
    text-align: center;
}
