/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #000000;
    --secondary: #ffffff;
    --accent: #666666;
    --light-gray: #f8f9fa;
    --medium-gray: #e0e0e0;
    --dark-gray: #333333;
    --success: #28a745;
    --error: #dc3545;
    --warning: #ffc107;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
    --radius: 10px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: var(--dark-gray);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== CONTAINER & LAYOUT ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-wrapper {
    min-height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
}

/* ===== NAVIGATION ===== */
.navbar {
    background: var(--secondary);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--medium-gray);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 70px;
}

.navbar-brand {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.5px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-brand:hover {
    color: var(--accent);
}

.brand-icon {
    font-size: 1.5rem;
}

.navbar-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.navbar-item {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    padding: 8px 16px;
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
}

.navbar-item:hover {
    color: var(--primary);
    background: var(--light-gray);
}

.navbar-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

.navbar-item:hover::after {
    width: 100%;
}

.navbar-item.active {
    color: var(--primary);
    background: var(--light-gray);
}

.navbar-item.active::after {
    width: 100%;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    background: var(--primary);
    color: var(--secondary);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    text-align: center;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    background: var(--dark-gray);
    border-color: var(--dark-gray);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

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

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

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

.btn-block {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
}

.btn-icon {
    font-size: 1.2rem;
}

/* ===== CARDS ===== */
.card {
    background: var(--secondary);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px;
    margin-bottom: 30px;
    transition: var(--transition);
    border: 1px solid var(--medium-gray);
}

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

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

.card-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-header p {
    color: var(--accent);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--dark-gray);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-control {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--medium-gray);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--secondary);
    color: var(--dark-gray);
    font-family: 'Inter', sans-serif;
}

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

.form-control::placeholder {
    color: #999;
}

.form-control-icon {
    position: absolute;
    right: 20px;
    top: 42px;
    color: var(--accent);
    font-size: 1.2rem;
}

/* ===== CODE INPUT STYLE ===== */
.code-input-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
}

.code-input {
    width: 60px;
    height: 80px;
    border: 2px solid var(--medium-gray);
    border-radius: var(--radius);
    font-size: 2rem;
    text-align: center;
    font-weight: 700;
    color: var(--primary);
    transition: var(--transition);
    background: var(--secondary);
}

.code-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.code-input.filled {
    border-color: var(--primary);
    background: var(--light-gray);
}

/* ===== ALERTS ===== */
.alert {
    padding: 16px 24px;
    border-radius: var(--radius);
    margin-bottom: 25px;
    font-weight: 500;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
}

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

.alert-success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
    border-color: rgba(40, 167, 69, 0.3);
}

.alert-error {
    background: rgba(220, 53, 69, 0.1);
    color: var(--error);
    border-color: rgba(220, 53, 69, 0.3);
}

.alert-icon {
    font-size: 1.2rem;
}

/* ===== DASHBOARD ===== */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.stat-card {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--light-gray) 100%);
    padding: 30px;
    border-radius: var(--radius);
    border-left: 5px solid var(--primary);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent 0%, rgba(0, 0, 0, 0.02) 100%);
    z-index: 1;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
    position: relative;
    z-index: 2;
}

.stat-label {
    color: var(--accent);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
    position: relative;
    z-index: 2;
}

.user-info {
    background: var(--light-gray);
    padding: 30px;
    border-radius: var(--radius);
    margin-bottom: 30px;
    border: 1px solid var(--medium-gray);
}

.user-info h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--medium-gray);
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 18px 0;
    border-bottom: 1px solid var(--medium-gray);
    transition: var(--transition);
}

.info-row:hover {
    background: rgba(255, 255, 255, 0.5);
    padding-left: 15px;
    padding-right: 15px;
    border-radius: var(--radius);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--accent);
    font-weight: 500;
    min-width: 150px;
}

.info-value {
    color: var(--primary);
    font-weight: 600;
    text-align: right;
    word-break: break-word;
}

/* ===== ACTION CARDS ===== */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.action-card {
    background: var(--secondary);
    padding: 25px;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--medium-gray);
    transition: var(--transition);
    cursor: pointer;
}

.action-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.action-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 15px;
}

.action-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 10px;
}

.action-desc {
    font-size: 0.9rem;
    color: var(--accent);
    line-height: 1.5;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--primary);
    color: var(--secondary);
    padding: 40px 0;
    margin-top: 60px;
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary);
    text-decoration: none;
}

.footer-links {
    display: flex;
    gap: 30px;
}

.footer-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-link:hover {
    color: var(--secondary);
}

.footer-copyright {
    text-align: center;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.animate-fade {
    animation: fadeIn 0.5s ease;
}

.animate-slide-up {
    animation: slideUp 0.5s ease;
}

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

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

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        height: auto;
        padding: 15px;
    }
    
    .navbar-menu {
        margin-top: 15px;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .navbar-item {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
    
    .card {
        padding: 25px;
    }
    
    .card-header h1 {
        font-size: 2rem;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .info-row {
        flex-direction: column;
        gap: 5px;
    }
    
    .info-label {
        min-width: auto;
    }
    
    .info-value {
        text-align: left;
    }
    
    .footer .container {
        flex-direction: column;
        gap: 20px;
    }
    
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    
    .code-input-container {
        gap: 10px;
    }
    
    .code-input {
        width: 50px;
        height: 70px;
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .card {
        padding: 20px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .code-input {
        width: 45px;
        height: 65px;
        font-size: 1.5rem;
    }
}

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

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

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

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

.animate-fade-in {
    animation: fadeIn 0.8s ease-out;
}

.animate-slide-left {
    animation: slideInLeft 0.8s ease-out;
}

.animate-slide-right {
    animation: slideInRight 0.8s ease-out;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* ===== LOADING STATES ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(10px);
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s linear infinite;
}

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

/* ===== GLOW EFFECTS ===== */
.glow {
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.glow:hover {
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}

/* ===== GRADIENT TEXT ===== */
.gradient-text {
    background: linear-gradient(135deg, #000 0%, #333 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
}