/* Cambodia Interclub Championship Ticketing System */
/* Premium Apple-inspired Design */

:root {
    --primary-color: #FFCC00;
    --primary-dark: #CC9900;
    --secondary-color: #5856D6;
    --success-color: #34C759;
    --warning-color: #FF9500;
    --danger-color: #FF3B30;
    --dark-color: #1C1C1E;
    --light-color: #F2F2F7;
    --white: #FFFFFF;
    --text-primary: #000000;
    --text-secondary: #8E8E93;
    --border-color: #E5E5EA;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    height: 50px;
    width: auto;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
    letter-spacing: -0.5px;
}

.event-date {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 2rem;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 5rem 0;
    color: var(--white);
    background-image: url('../../assets/images/hero.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    min-height: 600px;
    display: flex;
    align-items: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.3) 100%);
    z-index: 1;
}

.hero .container {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -2px;
    text-shadow: 2px 2px 20px rgba(0, 0, 0, 0.8);
}

.hero p {
    font-size: 1.3rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
    text-shadow: 1px 1px 10px rgba(0, 0, 0, 0.8);
}

/* Ticket Grid */
.tickets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

/* Ticket Card */
.ticket-card {
    background: var(--white);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.ticket-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.ticket-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.ticket-card.sold-out {
    opacity: 0.6;
    pointer-events: none;
}

.ticket-card.sold-out::after {
    content: 'SOLD OUT';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    font-size: 3rem;
    font-weight: 900;
    color: var(--danger-color);
    opacity: 0.2;
}

.ticket-header {
    margin-bottom: 1.5rem;
}

.ticket-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.ticket-price {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
}

.ticket-price small {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.ticket-details {
    margin: 1.5rem 0;
}

.ticket-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.badge-warning {
    background: rgba(255, 149, 0, 0.1);
    color: var(--warning-color);
}

.badge-success {
    background: rgba(52, 199, 89, 0.1);
    color: var(--success-color);
}

.badge-primary {
    background: rgba(0, 122, 255, 0.1);
    color: var(--primary-color);
}

/* Button */
.btn {
    width: 100%;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.4);
}

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

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--white);
    margin: 5% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
    border-radius: 20px 20px 0 0;
}

.modal-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark-color);
}

.close {
    float: right;
    font-size: 2rem;
    font-weight: 300;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.close:hover {
    color: var(--danger-color);
}

.modal-body {
    padding: 2rem;
    border-radius: 0 0 20px 20px;
}

/* Form */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

/* Admin Panel */
.admin-container {
    background: var(--white);
    border-radius: 20px;
    padding: 3rem;
    margin: 2rem auto;
    max-width: 1400px;
    box-shadow: var(--shadow-lg);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow-md);
}

.stat-card h3 {
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0.9;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card .stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.stat-card .stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Table */
.table-container {
    overflow-x: auto;
    margin-top: 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}

thead {
    background: var(--light-color);
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

tr:hover {
    background: var(--light-color);
}

/* Scanner */
#scanner-container {
    max-width: 600px;
    margin: 2rem auto;
    text-align: center;
}

#scanner-video {
    width: 100%;
    max-width: 500px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
}

.scan-result {
    margin-top: 2rem;
    padding: 2rem;
    border-radius: 15px;
    animation: slideUp 0.4s ease;
}

.scan-result.success {
    background: rgba(52, 199, 89, 0.1);
    border: 2px solid var(--success-color);
}

.scan-result.error {
    background: rgba(255, 59, 48, 0.1);
    border: 2px solid var(--danger-color);
}

/* Countdown Timer */
.countdown-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.countdown-item {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 204, 0, 0.3);
    border-radius: 15px;
    padding: 1.5rem 2rem;
    min-width: 120px;
    text-align: center;
}

.countdown-value {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    color: #FFCC00;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.countdown-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--white);
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

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

    .container {
        padding: 0 1rem;
    }

    .admin-container {
        padding: 1.5rem;
    }
}

/* Loading Spinner */
.spinner {
    border: 4px solid var(--light-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Alert */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-success {
    background: rgba(52, 199, 89, 0.1);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.alert-error {
    background: rgba(255, 59, 48, 0.1);
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

.alert-info {
    background: rgba(0, 122, 255, 0.1);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}