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

:root {
    /* Light Theme (Default) */
    --bg-color: #f8fafc;
    --surface-color: #ffffff;
    --surface-hover: #f1f5f9;
    --border-color: #e2e8f0;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --success: #059669;
    --danger: #dc2626;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

[data-theme="dark"] {
    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --surface-hover: #334155;
    --border-color: #334155;
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --success: #10b981;
    --danger: #ef4444;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-main);
}

.info-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    font-weight: 500;
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
    max-width: 100%; 
    box-sizing: border-box; 
    margin-top: 1rem;
}

.info-card svg {
    color: var(--primary);
}

.info-card table {
    margin-top: 0.5rem;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
    font-size: 0.9rem;
    line-height: 1.5;
    table-layout: fixed; 
}

.info-card td {
    padding: 0.25rem 0.5rem;
    padding-left: 5rem;
    background: transparent;
    vertical-align: top;
}

.info-card td:first-child {
    color: var(--text-muted);
    width: 1%;
    white-space: nowrap;
    padding-left: 0;
    text-transform: capitalize;
    vertical-align: top;
}

.info-card td:last-child {
    color: var(--text-main);
    font-weight: 600;
    word-break: break-all;
    overflow-wrap: break-word; 
    vertical-align: top;
}

.auth-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Buttons */
button {
    background: var(--primary);
    color: white;
    border: 1px solid transparent;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

button:hover {
    background: var(--primary-hover);
}
        
button.danger {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
    box-shadow: none;
}
button.danger:hover {
    background: var(--danger);
    color: white;
}

button.success {
    background: var(--success);
}
button.success:hover {
    background: var(--success);
    opacity: 0.9;
}
        
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.icon-btn {
    padding: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    box-shadow: none;
}
.icon-btn:hover {
    background: var(--surface-hover);
}

/* Forms */
.admin-controls {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: none;
    box-shadow: var(--shadow-sm);
}
        
.admin-controls.active {
    display: block;
}

.form-group {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

input[type="text"], input[type="file"], input[type="password"] {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.625rem 1rem;
    border-radius: 6px;
    outline: none;
    flex: 1;
    min-width: 200px;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
        
input[type="file"] {
    padding: 0.5rem;
}

input[type="text"]:focus, input[type="password"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Table */
.glass-panel {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

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

th, td {
    padding: 1rem 1.5rem;
    text-align: left;
}

th {
    background: var(--surface-hover);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

tr:last-child {
    border-bottom: none;
}

tr:hover {
    background: var(--surface-hover);
}

.status-badge {
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.status-paid {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-unpaid {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.proof-img {
    max-width: 48px;
    max-height: 48px;
    border-radius: 6px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s;
    border: 1px solid var(--border-color);
}
        
.proof-img:hover {
    transform: scale(1.05);
}

.actions {
    display: flex;
    gap: 0.5rem;
}
        
.admin-only {
    display: none;
}
        
body.is-admin .admin-only {
    display: flex;
    align-items: center;
}

body.is-admin .admin-only-table-cell {
    display: table-cell;
}
.admin-only-table-cell {
    display: none;
}

/* Modal / Lightbox */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s ease;
}
        
.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: center;
    max-width: 90%;
    max-height: 90%;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.modal-img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 6px;
    margin-bottom: 0;
}

.close-modal {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.25rem;
    line-height: 1;
}

.close-modal:hover {
    color: var(--text-main);
}
        
/* Empty state */
.empty-state {
    padding: 3rem;
    text-align: center;
    color: var(--text-muted);
}

/* Tutorial Modal Styles */
.tutorial-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    transition: border-color 0.2s ease;
}

.tutorial-card:hover {
    border-color: var(--primary);
}

.tutorial-card h3 {
    color: var(--text-main);
    font-size: 1.05rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.step-num {
    background: var(--primary);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.tutorial-card ol {
    padding-left: 1.25rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.tutorial-card li {
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
}

.tutorial-card li strong {
    color: var(--text-main);
}

.fab-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    height: 50px;
    padding: 0 1.5rem;
    border-radius: 25px;
    background: var(--primary);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    z-index: 100;
    transition: all 0.2s ease;
    border: none;
    font-weight: 500;
}

.fab-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

#tutorial-modal .modal-content {
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    text-align: left;
    padding: 2rem;
}

#tutorial-modal .modal-content::-webkit-scrollbar { width: 6px; }
#tutorial-modal .modal-content::-webkit-scrollbar-track { background: transparent; }
#tutorial-modal .modal-content::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 8px; }

.download-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 200px;
    padding: 0.625rem 1rem;
    background: var(--surface-hover);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    justify-content: center;
    transition: all 0.2s ease;
}

.download-btn:hover {
    background: var(--bg-color);
    border-color: var(--primary);
}

/* Sidebar Styles */
.app-wrapper { display: flex; min-height: 100vh; }
.sidebar { 
    width: 250px; 
    background: var(--surface-color); 
    border-right: 1px solid var(--border-color); 
    padding: 1.5rem 1rem; 
    display: flex; 
    flex-direction: column; 
    gap: 0.25rem; 
    flex-shrink: 0; 
    transition: left 0.3s ease; 
}

.sidebar-logo { 
    font-size: 1.25rem; 
    font-weight: 700; 
    color: var(--text-main);
    margin-bottom: 2rem; 
    padding: 0 0.75rem; 
}

.sidebar-link { 
    display: flex; 
    align-items: center; 
    gap: 0.75rem; 
    padding: 0.625rem 0.75rem; 
    color: var(--text-muted); 
    text-decoration: none; 
    border-radius: 6px; 
    transition: all 0.2s; 
    font-weight: 500; 
    font-size: 0.875rem;
}

.sidebar-link:hover { 
    background: var(--surface-hover); 
    color: var(--text-main); 
}

.sidebar-link.active { 
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
}

.main-content { flex: 1; min-width: 0; height: 100vh; overflow-y: auto; }
.mobile-header { display: none; }
.sidebar-overlay { display: none; }

/* Responsive Design */
@media (max-width: 1024px) {
    .container { padding: 1.5rem; }
}

@media (max-width: 768px) {
    .app-wrapper { flex-direction: column; }
    .sidebar { position: fixed; left: -250px; top: 0; height: 100vh; z-index: 1000; background: var(--surface-color); }
    .sidebar.open { left: 0; }
    .sidebar-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.5); z-index: 999; backdrop-filter: blur(2px); }
    .sidebar-overlay.active { display: block; }
    .main-content { height: auto; overflow-y: visible; }
    
    .mobile-header { 
        display: flex; 
        justify-content: space-between;
        align-items: center; 
        padding: 1rem 1.5rem; 
        background: var(--surface-color); 
        border-bottom: 1px solid var(--border-color); 
        position: sticky; 
        top: 0; 
        z-index: 900; 
    }
    
    .mobile-nav-toggle { 
        background: none; 
        border: none; 
        color: var(--text-main); 
        margin-right: 1rem; 
        cursor: pointer; 
        display: flex; 
        align-items: center; 
        justify-content: center; 
        padding: 0.25rem; 
        box-shadow: none;
    }
    
    .mobile-header h2 { 
        font-size: 1.1rem; 
        font-weight: 600; 
        margin: 0; 
        color: var(--text-main); 
    }
    
    .container { padding-top: 1.5rem; }
    
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }
    
    header h1 { display: none; }
    
    .auth-section {
        width: 100%;
        justify-content: space-between;
        background: var(--surface-color);
        padding: 1rem 1.25rem;
        border-radius: 8px;
        border: 1px solid var(--border-color);
    }
    
    .glass-panel { overflow-x: auto; }
    table { min-width: 700px; }
    .actions { flex-wrap: wrap; }
    .info-card table { min-width: 100%; }
}

@media (max-width: 480px) {
    h1 { font-size: 1.5rem; }
    .info-card {
        font-size: 0.85rem;
        padding: 0.75rem 1rem;
        width: 100%;
        box-sizing: border-box;
    }
    .form-group {
        flex-direction: column;
        align-items: stretch;
    }
    input[type="text"], input[type="file"], input[type="password"] {
        min-width: 100%;
    }
    .modal-content {
        padding: 1.5rem 1rem;
    }
}
