/* =========================================================
   🍄 MARIO KARD - ADMIN CSS
   ========================================================= */

:root {
    --bg-dark: #0a0a0f;
    --bg-card: #12121a;
    --bg-sidebar: #0e0e14;
    --text-primary: #ffffff;
    --text-secondary: #888;
    --mario-red: #e52521;
    --mario-gold: #ffd700;
    --mario-green: #4ade80;
    --border-color: rgba(255, 255, 255, 0.1);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* ========== LOGIN SCREEN ========== */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 100%);
    z-index: 1000;
}

.login-box {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.login-logo .logo-emoji {
    font-size: 60px;
    display: block;
    margin-bottom: 15px;
}

.login-logo h1 {
    font-size: 28px;
    color: var(--mario-red);
    margin-bottom: 5px;
}

.login-logo p {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.login-form .form-group {
    margin-bottom: 20px;
    text-align: left;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.login-form input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 16px;
}

.login-form input:focus {
    outline: none;
    border-color: var(--mario-red);
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--mario-red), #ff4444);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s;
}

.login-btn:hover {
    transform: scale(1.02);
}

.login-error {
    color: var(--mario-red);
    margin-top: 15px;
    font-size: 14px;
}

/* ========== ADMIN PANEL ========== */
.admin-panel {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
}

.sidebar-header {
    padding: 25px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header .logo-emoji {
    font-size: 36px;
}

.sidebar-header h2 {
    font-size: 18px;
    color: var(--mario-red);
}

.admin-badge {
    display: inline-block;
    background: var(--mario-gold);
    color: #000;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-item.active {
    background: rgba(229, 37, 33, 0.15);
    color: var(--mario-red);
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.logout-btn {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: rgba(229, 37, 33, 0.2);
    border-color: var(--mario-red);
    color: var(--mario-red);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
    min-height: 100vh;
}

.section {
    display: none;
}

.section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-header h1 {
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-header h1 i {
    color: var(--mario-red);
}

.add-btn {
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--mario-red), #ff4444);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid var(--border-color);
}

.stat-card i {
    font-size: 30px;
    color: var(--mario-red);
    opacity: 0.8;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Cards Table */
.cards-table {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.cards-table table {
    width: 100%;
    border-collapse: collapse;
}

.cards-table th,
.cards-table td {
    padding: 15px 20px;
    text-align: left;
}

.cards-table th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
}

.cards-table td {
    border-bottom: 1px solid var(--border-color);
}

.cards-table tr:last-child td {
    border-bottom: none;
}

.cards-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.action-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    margin-right: 5px;
}

.action-btn.delete {
    background: rgba(229, 37, 33, 0.2);
    color: var(--mario-red);
}

/* Import Section */
.import-box {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 25px;
    border: 1px solid var(--border-color);
}

.import-info {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.import-box textarea {
    width: 100%;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-family: monospace;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 15px;
}

.import-box textarea:focus {
    outline: none;
    border-color: var(--mario-red);
}

.import-price-row {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid var(--mario-gold);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.import-price-row label {
    display: block;
    margin-bottom: 8px;
    color: var(--mario-gold);
    font-weight: 600;
}

.import-price-row input {
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid var(--mario-gold);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 16px;
}

.import-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--mario-red), #ff4444);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.import-result {
    margin-top: 20px;
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid var(--mario-green);
    border-radius: var(--radius);
    padding: 20px;
}

.import-result h3 {
    color: var(--mario-green);
    margin-bottom: 15px;
}

/* Message Editor */
.message-editor {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 25px;
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.form-group textarea,
.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 14px;
    font-family: 'Nunito', sans-serif;
}

.form-group textarea:focus,
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--mario-red);
}

/* Toggle */
.toggle-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-input {
    display: none;
}

.toggle-label {
    position: relative;
    width: 50px;
    height: 26px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle-input:checked + .toggle-label {
    background: var(--mario-green);
}

.toggle-switch {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.toggle-input:checked + .toggle-label .toggle-switch {
    transform: translateX(24px);
}

.toggle-text {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Templates */
.templates {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.templates span {
    color: var(--text-secondary);
    font-size: 13px;
}

.templates button {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: white;
    font-size: 13px;
    cursor: pointer;
}

.templates button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.save-btn {
    padding: 14px 25px;
    background: linear-gradient(135deg, var(--mario-green), #22c55e);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Bot Config */
.bot-config {
    display: grid;
    gap: 25px;
}

.config-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 25px;
    border: 1px solid var(--border-color);
}

.config-card h3 {
    font-size: 18px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.config-note {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 20px;
}

.config-card small {
    display: block;
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 5px;
}

.send-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.send-btn {
    padding: 12px 20px;
    background: rgba(0, 136, 204, 0.2);
    border: 1px solid #0088cc;
    border-radius: 8px;
    color: #0088cc;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.send-btn:hover {
    background: #0088cc;
    color: white;
}

/* Config Grid */
.config-grid {
    display: grid;
    gap: 25px;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.danger-btn {
    padding: 12px 20px;
    background: rgba(229, 37, 33, 0.15);
    border: 1px solid var(--mario-red);
    border-radius: 8px;
    color: var(--mario-red);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 10px;
    width: 100%;
}

.danger-btn:hover {
    background: var(--mario-red);
    color: white;
}

.export-btn {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    width: 100%;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    border: 1px solid var(--border-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.cancel-btn {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
}

.confirm-btn {
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--mario-red), #ff4444);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    border: 1px solid var(--mario-green);
    font-size: 14px;
    z-index: 2000;
}

.toast.error {
    border-color: var(--mario-red);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        transition: left 0.3s;
        z-index: 100;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    
    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stats-row {
        grid-template-columns: 1fr;
    }
    
    .cards-table {
        overflow-x: auto;
    }
    
    .cards-table table {
        min-width: 600px;
    }
}
