/* ============================================
   PONGAL 2026 - Event Ticket Generation System
   Mobile-First CSS with Pongal Theme
   Colors: Gold (#FFD700), Maroon (#800000), Green (#228B22)
   ============================================ */

/* ============================================
   CSS VARIABLES & RESET
   ============================================ */
:root {
    --primary-gold: #FFD700;
    --primary-maroon: #800000;
    --primary-green: #228B22;
    --light-cream: #FFF8DC;
    --white: #FFFFFF;
    --dark-text: #333333;
    --light-text: #666666;
    --border-color: #DDD;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--light-cream) 0%, #FFE4B5 100%);
    min-height: 100vh;
    color: var(--dark-text);
    line-height: 1.6;
}

/* ============================================
   COMMON STYLES
   ============================================ */
.container {
    max-width: 420px;
    margin: 0 auto;
    padding: 20px;
}

.logo {
    display: block;
    margin: 0 auto 20px;
    max-height: 80px;
    width: auto;
    object-fit: contain;
}

h1, h2, h3 {
    color: var(--primary-maroon);
    margin-bottom: 15px;
}

h1 {
    font-size: 1.8rem;
    text-align: center;
}

h2 {
    font-size: 1.4rem;
    text-align: center;
}

h3 {
    font-size: 1.2rem;
}

button {
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
}

/* ============================================
   FORM STYLES
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--primary-maroon);
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: var(--white);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-gold);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2);
}

.btn-primary {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--primary-maroon) 0%, #A52A2A 100%);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-secondary {
    width: 100%;
    padding: 12px 20px;
    background: var(--white);
    color: var(--primary-maroon);
    border: 2px solid var(--primary-maroon);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 10px;
}

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

.btn-download {
    background: linear-gradient(135deg, var(--primary-green) 0%, #2E8B57 100%);
    color: var(--white);
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    width: 100%;
    margin-top: 10px;
}

.btn-download:hover {
    background: linear-gradient(135deg, #2E8B57 0%, #3CB371 100%);
}

/* ============================================
   TICKET STYLES
   ============================================ */
.ticket-container {
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    margin-bottom: 30px;
}

.ticket-header {
    background: linear-gradient(135deg, var(--primary-maroon) 0%, #A52A2A 100%);
    color: var(--white);
    padding: 30px 20px;
    text-align: center;
    position: relative;
}

.ticket-header::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    right: 0;
    height: 20px;
    background: var(--white);
    border-radius: 50% 50% 0 0;
}

.ticket-logo {
    max-height: 60px;
    margin-bottom: 15px;
    object-fit: contain;
}

.ticket-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.ticket-welcome {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 10px;
}

.ticket-body {
    padding: 30px 20px;
}

.ticket-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px dashed var(--border-color);
}

.ticket-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.ticket-section-title {
    color: var(--primary-maroon);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.ticket-info {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.ticket-info-item {
    flex: 1 1 100%;
    min-width: 200px;
}

.ticket-label {
    font-size: 0.85rem;
    color: var(--light-text);
    margin-bottom: 3px;
}

.ticket-value {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--dark-text);
}

.ticket-qr {
    text-align: center;
    padding: 20px;
    background: var(--light-cream);
    border-radius: 12px;
    margin: 20px 0;
}

.ticket-qr img {
    max-width: 200px;
    width: 100%;
    height: auto;
}

.ticket-qr-text {
    font-size: 0.85rem;
    color: var(--light-text);
    margin-top: 10px;
}

.ticket-footer {
    background: linear-gradient(135deg, var(--primary-gold) 0%, #FFA500 100%);
    color: var(--primary-maroon);
    text-align: center;
    padding: 15px 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.ticket-id {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    background: var(--light-cream);
    padding: 8px 15px;
    border-radius: 20px;
    display: inline-block;
    margin-top: 10px;
    font-weight: 700;
    color: var(--primary-maroon);
}

/* ============================================
   ADMIN PANEL STYLES
   ============================================ */
.admin-login {
    max-width: 400px;
    margin: 50px auto;
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.admin-header {
    background: linear-gradient(135deg, var(--primary-maroon) 0%, #A52A2A 100%);
    color: var(--white);
    padding: 20px;
    text-align: center;
    margin-bottom: 30px;
    border-radius: 12px 12px 0 0;
}

.admin-logo {
    max-height: 50px;
    margin-bottom: 10px;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-maroon);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--light-text);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.search-box {
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.search-box input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
}

.ticket-list {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.ticket-list-item {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease;
}

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

.ticket-list-item:last-child {
    border-bottom: none;
}

.ticket-list-info {
    flex: 1;
}

.ticket-list-name {
    font-weight: 600;
    color: var(--dark-text);
    margin-bottom: 3px;
}

.ticket-list-details {
    font-size: 0.85rem;
    color: var(--light-text);
}

.ticket-list-actions {
    display: flex;
    gap: 10px;
}

.btn-action {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-view {
    background: var(--primary-gold);
    color: var(--primary-maroon);
}

.btn-delete {
    background: #DC143C;
    color: var(--white);
}

.btn-export {
    background: var(--primary-green);
    color: var(--white);
    margin-top: 20px;
}

/* ============================================
   VALIDATION PAGE STYLES
   ============================================ */
.validation-box {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 20px;
}

.validation-result {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.valid-ticket {
    border-left: 5px solid var(--primary-green);
}

.invalid-ticket {
    border-left: 5px solid #DC143C;
}

.status-badge {
    display: inline-block;
    padding: 10px 25px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.status-valid {
    background: var(--primary-green);
    color: var(--white);
}

.status-invalid {
    background: #DC143C;
    color: var(--white);
}

/* ============================================
   TAMIL TEXT SUPPORT
   ============================================ */
.tamil-text {
    font-family: 'Noto Sans Tamil', 'Segoe UI', Tahoma, sans-serif;
    line-height: 1.8;
}

/* ============================================
   ERROR & SUCCESS MESSAGES
   ============================================ */
.message {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.error {
    background: #FFE4E4;
    color: #DC143C;
    border-left: 4px solid #DC143C;
}

.success {
    background: #E8FFE8;
    color: var(--primary-green);
    border-left: 4px solid var(--primary-green);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 420px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    .ticket-title {
        font-size: 1.3rem;
    }

    .ticket-welcome {
        font-size: 0.9rem;
    }

    .stat-value {
        font-size: 2rem;
    }
}

@media (min-width: 421px) and (max-width: 768px) {
    .container {
        max-width: 500px;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    body {
        background: var(--white);
    }

    .container {
        max-width: 100%;
    }

    button,
    .admin-panel,
    .search-box,
    .ticket-list {
        display: none !important;
    }

    .ticket-container {
        box-shadow: none;
        border: 2px solid var(--primary-maroon);
        page-break-inside: avoid;
    }

    .ticket-qr img {
        max-width: 150px;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ticket-container,
.admin-login,
.validation-box {
    animation: fadeIn 0.5s ease;
}

/* ============================================
   LOADING SPINNER
   ============================================ */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--light-cream);
    border-top-color: var(--primary-maroon);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   ORGANIZATION INFO STYLES
   ============================================ */
.org-info {
    text-align: center;
    padding: 20px;
    background: var(--light-cream);
    border-radius: 12px;
    margin-bottom: 30px;
}

.org-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-maroon);
    margin-bottom: 5px;
}

.org-details {
    font-size: 0.85rem;
    color: var(--light-text);
}

.contacts {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.contact-item {
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: var(--dark-text);
}

/* ============================================
   NAVIGATION
   ============================================ */
.admin-nav {
    display: flex;
    background: var(--primary-maroon);
    padding: 10px 15px;
    margin: -30px -30px 30px -30px;
    border-radius: 12px 12px 0 0;
}

.admin-nav button {
    flex: 1;
    padding: 10px 15px;
    background: transparent;
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-right: 10px;
}

.admin-nav button:last-child {
    margin-right: 0;
}

.admin-nav button.active {
    background: var(--primary-gold);
    color: var(--primary-maroon);
}

.admin-nav button:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
}