:root {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-tertiary: #0f0f1a;
    --bg-card: #1e1e3f;
    --text-primary: #ffffff;
    --text-secondary: #b8b8d1;
    --text-muted: #6c6c8a;
    --accent-primary: #5865f2;
    --accent-hover: #4752c4;
    --accent-success: #43b581;
    --accent-danger: #f04747;
    --accent-warning: #faa61a;
    --border-color: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-tertiary) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

.screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* MCCG Login Screen */
.mccg-container {
    text-align: center;
    max-width: 950px;
    width: 100%;
}

.mccg-header {
    margin-bottom: 32px;
}

.mccg-header h1 {
    font-size: 56px;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #5865f2, #eb459e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

.mccg-header .tagline {
    color: var(--text-secondary);
    font-size: 18px;
    font-weight: 400;
}

.login-preview-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-label {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-label::before {
    content: '';
    width: 24px;
    height: 24px;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 127.14 96.36"><path fill="%235865f2" d="M107.7,8.07A105.15,105.15,0,0,0,81.47,0a72.06,72.06,0,0,0-3.36,6.83A97.68,97.68,0,0,0,49,6.83,72.37,72.37,0,0,0,45.64,0,105.89,105.89,0,0,0,19.39,8.09C2.79,32.65-1.71,56.6.54,80.21h0A105.73,105.73,0,0,0,32.71,96.36,77.7,77.7,0,0,0,39.6,85.25a68.42,68.42,0,0,1-10.85-5.18c.91-.66,1.8-1.34,2.66-2a75.57,75.57,0,0,0,64.32,0c.87.71,1.76,1.39,2.66,2a68.68,68.68,0,0,1-10.87,5.19,77,77,0,0,0,6.89,11.1A105.25,105.25,0,0,0,126.6,80.22h0C129.24,52.84,122.09,29.11,107.7,8.07ZM42.45,65.69C36.18,65.69,31,60,31,53s5-12.74,11.43-12.74S54,46,53.89,53,48.84,65.69,42.45,65.69Zm42.24,0C78.41,65.69,73.25,60,73.25,53s5-12.74,11.44-12.74S96.23,46,96.12,53,91.08,65.69,84.69,65.69Z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
}

/* Fake Browser Window */
.browser-window {
    background: #202225;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 900px;
    max-width: 100%;
}

.browser-chrome {
    background: #2f3136;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.3);
}

.browser-tabs {
    display: flex;
    gap: 4px;
}

.browser-tab {
    background: #202225;
    padding: 6px 12px;
    border-radius: 6px 6px 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #dcddde;
    max-width: 200px;
}

.browser-tab.active {
    background: #36393f;
}

.tab-favicon {
    width: 16px;
    height: 16px;
    border-radius: 2px;
    flex-shrink: 0;
}

#tab-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* URL Bar */
.url-bar-container {
    background: #36393f;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

.url-bar {
    background: #202225;
    border-radius: 6px;
    display: flex;
    align-items: center;
    padding: 6px 12px;
    gap: 8px;
}

.url-security {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.url-security svg {
    width: 16px;
    height: 16px;
}

.url-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #dcddde;
    font-size: 14px;
    font-family: inherit;
    min-width: 0;
}

.url-input:focus {
    color: #ffffff;
}

.url-input::selection {
    background: var(--accent-primary);
}

.url-actions {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    flex-shrink: 0;
}

.url-actions:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Browser Content - FIXED SIZE */
.browser-content {
    background: #313338;
    width: 100%;
    height: 520px;
    position: relative;
    overflow: hidden;
}

.browser-content iframe {
    width: 100%;
    height: 100%;
    display: block;
    border: none;
}

/* Error Page - Positioned absolutely within browser-content */
.error-page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1e1f22;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.error-content {
    text-align: center;
    color: #b5bac1;
    padding: 20px;
}

.error-content svg {
    margin-bottom: 24px;
    opacity: 0.5;
}

.error-content h2 {
    font-size: 20px;
    color: #ffffff;
    margin-bottom: 8px;
    font-weight: 500;
}

.error-content p {
    font-size: 14px;
    color: #b5bac1;
    margin-bottom: 4px;
}

.error-content .error-code {
    font-family: monospace;
    font-size: 12px;
    color: #72767d;
    margin-top: 16px;
}

/* Warning Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    padding: 32px;
    border-radius: 12px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    border: 1px solid var(--border-color);
    animation: modalIn 0.2s ease;
    z-index: 2001;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-icon {
    margin-bottom: 16px;
}

.modal-content h2 {
    font-size: 24px;
    margin-bottom: 12px;
    color: var(--accent-danger);
}

.modal-content p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.danger-btn {
    background: var(--accent-danger);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.danger-btn:hover {
    background: #d43f3f;
}

/* Status Screens */
.status-box {
    background: var(--bg-card);
    padding: 48px;
    border-radius: 16px;
    text-align: center;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
}

.status-icon {
    margin-bottom: 24px;
}

.status-box h1 {
    font-size: 28px;
    margin-bottom: 12px;
}

.status-box p {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.5;
}

.loading-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    margin-top: 24px;
    overflow: hidden;
}

.loading-progress {
    width: 0%;
    height: 100%;
    background: var(--accent-success);
    border-radius: 2px;
    animation: loadingProgress 2s ease forwards;
}

@keyframes loadingProgress {
    to { width: 100%; }
}

.error-box {
    max-width: 520px;
}

.warning-banner {
    background: rgba(250, 166, 26, 0.1);
    border: 1px solid var(--accent-warning);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}

.warning-banner p {
    color: var(--accent-warning);
    font-size: 14px;
}

.error-message {
    margin-bottom: 24px;
}

/* Buttons */
.primary-btn {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.primary-btn:hover {
    background: var(--accent-hover);
}

.secondary-btn {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.icon-btn {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.icon-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Eye Button for Show/Hide */
.eye-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.eye-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

/* Admin Access Button */
.admin-access-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(88, 101, 242, 0.4);
}

.admin-access-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

/* Admin Panel */
.admin-panel {
    width: 100%;
    min-height: 100vh;
}

.admin-header {
    background: var(--bg-secondary);
    padding: 20px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.admin-header h1 {
    font-size: 24px;
    font-weight: 600;
}

.admin-content {
    padding: 32px;
    max-width: 1400px;
    margin: 0 auto;
}

.admin-section {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.badge {
    background: var(--accent-primary);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
}

/* Code Generator */
.code-generator {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.generated-code {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-tertiary);
    padding: 12px 16px;
    border-radius: 8px;
}

.generated-code span:first-child {
    font-family: monospace;
    font-size: 16px;
    color: var(--accent-success);
    min-width: 220px;
    letter-spacing: 1px;
}

.generated-code .code-hidden {
    color: var(--text-muted);
}

.code-status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.code-status.working {
    background: rgba(67, 181, 129, 0.2);
    color: var(--accent-success);
}

.code-status.used {
    background: rgba(240, 71, 71, 0.2);
    color: var(--accent-danger);
}

/* Codes List */
.codes-list-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.codes-list-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.codes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.code-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-tertiary);
    padding: 12px 16px;
    border-radius: 8px;
}

.code-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.code-item-code {
    font-family: monospace;
    font-size: 14px;
    color: var(--text-primary);
    min-width: 200px;
}

.code-item-code.code-hidden {
    color: var(--text-muted);
}

.code-item-date {
    font-size: 12px;
    color: var(--text-muted);
}

.code-item-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Users Table */
.users-table-container {
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th,
.users-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.users-table th {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.users-table td {
    font-size: 14px;
}

.users-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.password-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.password-text {
    font-family: monospace;
    min-width: 100px;
}

.empty-state {
    color: var(--text-muted);
    text-align: center;
    padding: 24px;
}

/* Stats */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    padding: 0;
    background: transparent;
    border: none;
}

.stat-card {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.stat-card h3 {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.stat-card span {
    font-size: 36px;
    font-weight: 700;
    color: var(--accent-primary);
}

/* Delete Button */
.delete-btn {
    background: transparent;
    border: 1px solid var(--accent-danger);
    color: var(--accent-danger);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.delete-btn:hover {
    background: var(--accent-danger);
    color: white;
}

/* Responsive */
@media (max-width: 950px) {
    .browser-window {
        width: 100%;
    }
    
    .browser-content {
        height: 500px;
    }
    
    .mccg-header h1 {
        font-size: 40px;
    }
    
    .mccg-header .tagline {
        font-size: 14px;
    }
    
    .admin-content {
        padding: 16px;
    }
}

@media (max-width: 600px) {
    .browser-content {
        height: 450px;
    }
    
    .browser-chrome {
        padding: 6px 10px;
    }
    
    .url-bar {
        padding: 4px 8px;
    }
    
    .url-input {
        font-size: 12px;
    }
    
    .generated-code {
        flex-wrap: wrap;
    }
    
    .generated-code span:first-child {
        min-width: 150px;
        font-size: 12px;
    }
    
    .modal-content {
        padding: 24px;
    }
    
    .modal-buttons {
        flex-direction: column;
    }
}
