@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Inter:wght@300;400;500;600&display=swap');

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

:root {
    --primary-gold: #D4AF37;
    --primary-gold-light: #E8D5A3;
    --primary-gold-dark: #B8941F;
    --accent-blue: #2C5F7C;
    --accent-blue-light: #4A8BAD;
    --text-dark: #2C3E50;
    --text-light: #7F8C8D;
    --bg-white: #FFFFFF;
    --bg-light: #F8F9FA;
    --bg-cream: #FEFCF8;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-cream) url('/bg.svg') no-repeat center center;
    background-size: cover;
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px;
    color: var(--text-dark);
    line-height: 1.6;
    animation: fadeIn 0.6s ease-in;
    position: relative;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    animation: slideUp 0.8s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header {
    background: var(--bg-white);
    padding: 25px 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 4px solid var(--primary-gold);
    animation: slideDown 0.6s ease-out;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header h1 {
    font-family: 'Playfair Display', serif;
    color: var(--accent-blue);
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
    position: relative;
}

header h1::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-gold), transparent);
    border-radius: 2px;
}

.auth-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
    color: var(--text-light);
}

.auth-info span {
    font-weight: 500;
    color: var(--text-dark);
}

.btn-logout {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #E74C3C, #C0392B);
    color: white;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.btn-logout::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-logout:hover::before {
    width: 300px;
    height: 300px;
}

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

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

main {
    background: var(--bg-white);
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: linear-gradient(135deg, var(--bg-white) 0%, var(--bg-light) 100%);
    padding: 35px 25px;
    border-radius: 16px;
    text-align: center;
    color: var(--text-dark);
    box-shadow: var(--shadow-sm);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    animation: cardFadeIn 0.6s ease-out both;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }
.stat-card:nth-child(5) { animation-delay: 0.5s; }

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-gold), var(--accent-blue));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-gold-light);
}

.stat-icon {
    font-size: 56px;
    margin-bottom: 15px;
    display: inline-block;
    animation: iconFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(212, 175, 55, 0.2));
}

.stat-card:nth-child(1) .stat-icon { animation-delay: 0s; }
.stat-card:nth-child(2) .stat-icon { animation-delay: 0.2s; }
.stat-card:nth-child(3) .stat-icon { animation-delay: 0.4s; }
.stat-card:nth-child(4) .stat-icon { animation-delay: 0.6s; }
.stat-card:nth-child(5) .stat-icon { animation-delay: 0.8s; }

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.stat-value {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--accent-blue);
    font-family: 'Playfair Display', serif;
    position: relative;
    display: inline-block;
    animation: countUp 0.8s ease-out;
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-value::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: var(--primary-gold);
    border-radius: 2px;
}

.stat-label {
    font-size: 15px;
    color: var(--text-light);
    font-weight: 500;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    font-size: 13px;
}

.last-update {
    text-align: center;
    padding: 25px;
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-cream) 100%);
    border-radius: 12px;
    color: var(--text-light);
    border: 1px solid rgba(212, 175, 55, 0.2);
    animation: fadeIn 0.8s ease-out 0.4s both;
}

.last-update p {
    font-size: 15px;
    font-weight: 500;
}

#update-time {
    color: var(--accent-blue);
    font-weight: 600;
}

.no-data {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-light);
    animation: fadeIn 0.8s ease-out;
}

.no-data p {
    font-size: 20px;
    margin-bottom: 25px;
    color: var(--text-dark);
    font-weight: 500;
}

.actions {
    text-align: center;
    margin-top: 40px;
    animation: fadeIn 0.8s ease-out 0.6s both;
}

.btn-primary, .btn-secondary {
    padding: 14px 36px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 8px;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-gold) 0%, var(--primary-gold-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

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

.btn-primary:disabled {
    animation: pulse 1.5s ease-in-out infinite;
    cursor: not-allowed;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.btn-secondary {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-blue-light) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(44, 95, 124, 0.2);
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(44, 95, 124, 0.3);
}

/* Login Page */
.login-container {
    max-width: 450px;
    margin: 80px auto;
    background: var(--bg-white);
    padding: 50px 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border-top: 4px solid var(--primary-gold);
    animation: slideUp 0.8s ease-out;
}

.login-container h1 {
    text-align: center;
    color: var(--accent-blue);
    margin-bottom: 35px;
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    font-weight: 700;
}

.login-form {
    margin-top: 25px;
}

.form-group {
    margin-bottom: 25px;
    animation: fadeInUp 0.6s ease-out both;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.3px;
}

.form-group input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #E8E8E8;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: var(--bg-light);
    font-family: 'Inter', sans-serif;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-gold);
    background: var(--bg-white);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.1);
    transform: translateY(-2px);
}

.login-footer {
    text-align: center;
    margin-top: 25px;
}

.login-footer a {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-block;
}

.login-footer a:hover {
    color: var(--primary-gold);
    transform: translateX(-5px);
}

/* Create Page */
.form-container {
    max-width: 650px;
    margin: 0 auto;
}

.create-form {
    margin-top: 25px;
}

.create-form .form-group {
    animation: fadeInUp 0.6s ease-out both;
}

.create-form .form-group:nth-child(1) { animation-delay: 0.1s; }
.create-form .form-group:nth-child(2) { animation-delay: 0.2s; }
.create-form .form-group:nth-child(3) { animation-delay: 0.3s; }
.create-form .form-group:nth-child(4) { animation-delay: 0.4s; }
.create-form .form-group:nth-child(5) { animation-delay: 0.5s; }

.create-form .form-group label {
    font-size: 15px;
    margin-bottom: 12px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.create-form .form-group label::before {
    content: '▸';
    color: var(--primary-gold);
    font-size: 12px;
    transition: transform 0.3s ease;
}

.create-form .form-group:focus-within label::before {
    transform: rotate(90deg);
}

.form-group input[type="number"] {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #E8E8E8;
    border-radius: 12px;
    font-size: 18px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-light);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    position: relative;
}

.form-group input[type="number"]:hover {
    border-color: var(--primary-gold-light);
    background: var(--bg-white);
}

.form-group input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-gold);
    background: var(--bg-white);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.15);
    transform: translateY(-2px);
}

.form-group input[type="number"]::placeholder {
    color: #B0B0B0;
    font-weight: 400;
}

.form-actions {
    margin-top: 40px;
    text-align: center;
}

.error-message {
    background: linear-gradient(135deg, #FFF5F5 0%, #FFE5E5 100%);
    color: #C53030;
    padding: 18px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    border-left: 4px solid #C53030;
    animation: shake 0.5s ease;
    box-shadow: var(--shadow-sm);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.success-message {
    background: linear-gradient(135deg, #F0FFF4 0%, #E6FFED 100%);
    color: #2F855A;
    padding: 18px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    border-left: 4px solid #2F855A;
    animation: slideInRight 0.5s ease;
    box-shadow: var(--shadow-sm);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
        padding: 20px 25px;
    }

    header h1 {
        font-size: 26px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .stat-card {
        padding: 30px 20px;
    }

    main {
        padding: 25px 20px;
    }

    .login-container {
        margin: 40px 15px;
        padding: 35px 25px;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
        margin: 8px 0;
    }
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Selection color */
::selection {
    background: var(--primary-gold-light);
    color: var(--text-dark);
}

/* Decorative elements */
.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.05) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.stat-card:hover::after {
    opacity: 1;
}

/* Background overlay for better readability */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(254, 252, 248, 0.85);
    pointer-events: none;
    z-index: -1;
}

/* Enhanced focus states */
*:focus-visible {
    outline: 2px solid var(--primary-gold);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Smooth transitions for all interactive elements */
a, button, input, select, textarea {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

