* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #151515;
    --accent-primary: #ffffff;
    --accent-secondary: #e0e0e0;
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --border-color: #1a1a1a;
    --success: #00ff00;
    --error: #ff0000;
    --gradient: linear-gradient(135deg, #ffffff 0%, #cccccc 100%);
    --hover-bg: #1a1a1a;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Loader */
.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loader-content {
    text-align: center;
    width: 90%;
    max-width: 400px;
}

.loader-content .logo {
    font-size: 3rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    animation: pulse 2s ease-in-out infinite;
}

.logo-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-weight: 300;
    letter-spacing: 1px;
}

.loader-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
    position: relative;
}

.loader-progress {
    height: 100%;
    background: #ffffff;
    border-radius: 10px;
    width: 0%;
    transition: width 0.1s ease;
    position: relative;
    overflow: hidden;
}

.loader-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 1.5s infinite;
}

.loader-text {
    font-size: 1.5rem;
    color: var(--text-secondary);
    font-weight: 600;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Main Content */
.main-content {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: #000000;
    position: relative;
}

.main-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,0.02) 0%, transparent 70%);
    pointer-events: none;
}

.container {
    width: 100%;
    max-width: 500px;
    position: relative;
    z-index: 1;
    margin: 0 auto;
}

/* Login Card */
.login-section {
    width: 100%;
    display: flex;
    justify-content: center;
}

.login-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.logo-large {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 0.5rem;
}

.logo-subtitle-large {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 2rem;
    font-weight: 300;
    letter-spacing: 1px;
}

.logo-tagline {
    font-size: 0.7em;
    font-weight: 300;
    color: var(--text-secondary);
    margin-left: 0.5rem;
}

.login-card h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-primary);
    font-weight: 600;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group input {
    width: 100%;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.input-group input::placeholder {
    color: var(--text-secondary);
}

.btn-primary {
    width: 100%;
    padding: 1rem;
    background: #ffffff;
    border: none;
    border-radius: 10px;
    color: #000000;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.2);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    padding: 0.6rem 1.2rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--hover-bg);
    border-color: var(--accent-primary);
}

/* Dashboard */
.dashboard-container {
    min-height: 100vh;
    background: #000000;
}

.dashboard-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content .logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--text-primary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.dashboard-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.form-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.form-section h1 {
    margin-bottom: 2rem;
    font-size: 2rem;
    color: var(--text-primary);
}

.form-section-title {
    margin: 2rem 0 1.5rem 0;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.form-section-title h2 {
    font-size: 1.3rem;
    color: var(--text-primary);
    font-weight: 600;
}

.account-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-icon {
    font-size: 0.9rem;
    cursor: help;
    opacity: 0.7;
}

.form-group input[type="number"],
.form-group input[type="text"],
.form-group select {
    padding: 0.9rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.8rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.checkbox-label:hover {
    border-color: var(--accent-primary);
    background: var(--hover-bg);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.media-devices {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.media-input {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.media-input label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.media-input input {
    padding: 0.8rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
}

.btn-submit {
    margin-top: 1rem;
}

/* Stats Page */
.stats-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.stats-section h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.period-filter {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.period-btn {
    padding: 0.8rem 1.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.period-btn:hover {
    background: var(--hover-bg);
    border-color: var(--accent-primary);
}

.period-btn.active {
    background: #ffffff;
    border-color: transparent;
    color: #000000;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.1);
    border-color: var(--accent-primary);
}

.stat-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stats-details {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    margin-top: 2rem;
}

.stats-details h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.detail-section {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.detail-section:last-child {
    border-bottom: none;
}

.detail-section h3 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.detail-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.detail-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.detail-item:hover {
    border-color: var(--accent-primary);
    transform: translateX(5px);
}

.detail-item-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.detail-item-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }
    
    .container {
        max-width: 100%;
    }
    
    .login-card {
        padding: 2rem;
        width: 100%;
    }

    .dashboard-main,
    .stats-main {
        padding: 1.5rem 1rem;
    }

    .form-section {
        padding: 1.5rem;
    }

    .media-devices {
        grid-template-columns: 1fr;
    }

    .checkbox-group {
        grid-template-columns: 1fr;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .user-info {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Admin Panel */
.admin-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.admin-section h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.chart-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
}

.chart-container h2 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.chart-container canvas {
    max-height: 300px;
}

.users-list-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
}

.users-list-section h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.users-table-container {
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table thead {
    background: var(--bg-tertiary);
}

.users-table th {
    padding: 1rem;
    text-align: left;
    color: var(--text-primary);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.users-table td {
    padding: 1rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.users-table tbody tr:hover {
    background: var(--hover-bg);
}

.btn-small {
    padding: 0.4rem 0.8rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-small:hover {
    background: var(--hover-bg);
    border-color: var(--accent-primary);
}

.error-message {
    color: var(--error);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
    border-radius: 6px;
    text-align: center;
}

.password-message {
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-align: center;
}

.password-message code {
    display: inline-block;
    margin: 0.5rem 0;
    font-family: 'Courier New', monospace;
}

.input-group input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
