/**
 * DirectAdmin Client Panel - Stylesheet
 * Minimal/Clean Dark Theme with Pink Accent
 */

/* ========================
   CSS Variables
   ======================== */
:root {
    --primary: #E91E8C;
    --primary-dark: #C4177A;
    --primary-light: #FF4DA6;
    --bg-dark: #1A1A2E;
    --bg-darker: #12121F;
    --bg-card: #16213E;
    --bg-input: #0F3460;
    --text-light: #EAEAEA;
    --text-muted: #A0A0A0;
    --text-dark: #6B6B80;
    --success: #00D9A5;
    --warning: #FFB830;
    --danger: #FF4757;
    --info: #3498db;
    --border: #2D2D44;
    --shadow: rgba(0, 0, 0, 0.3);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.2s ease;
}

/* ========================
   Reset & Base
   ======================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-light);
}

/* ========================
   Layout
   ======================== */
.wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--bg-darker);
    border-right: 1px solid var(--border);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
    min-height: 100vh;
}

/* ========================
   Sidebar
   ======================== */
.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo img {
    height: 36px;
    width: auto;
}

.sidebar-logo h1 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-light);
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-section {
    margin-bottom: 20px;
}

.nav-section-title {
    padding: 10px 20px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dark);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-muted);
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: rgba(233, 30, 140, 0.1);
    color: var(--text-light);
}

.nav-link.active {
    background: rgba(233, 30, 140, 0.15);
    color: var(--primary);
    border-left-color: var(--primary);
}

.nav-link svg, .nav-link i {
    width: 20px;
    height: 20px;
    opacity: 0.7;
}

.nav-link.active svg, .nav-link.active i {
    opacity: 1;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-darker);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ========================
   Page Header
   ======================== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 600;
}

.page-subtitle {
    color: var(--text-muted);
    margin-top: 5px;
}

/* ========================
   Cards
   ======================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.1);
}

/* ========================
   Stats Cards
   ======================== */
.stats-grid {
    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-lg);
    padding: 25px;
    border: 1px solid var(--border);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 5px;
}

.stat-icon {
    float: right;
    width: 50px;
    height: 50px;
    background: rgba(233, 30, 140, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

/* ========================
   Forms
   ======================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-light);
    font-size: 1rem;
    transition: var(--transition);
}

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

.form-control::placeholder {
    color: var(--text-dark);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.form-hint {
    font-size: 0.85rem;
    color: var(--text-dark);
    margin-top: 5px;
}

.form-inline {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

.form-inline .form-group {
    margin-bottom: 0;
    flex: 1;
}

/* ========================
   Buttons
   ======================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-light);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
    color: var(--text-light);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #00c495;
}

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

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

.btn-warning {
    background: var(--warning);
    color: #1A1A2E;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 10px;
}

/* ========================
   Tables
   ======================== */
.table-responsive {
    overflow-x: auto;
}

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

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

.table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr:hover {
    background: rgba(233, 30, 140, 0.05);
}

.table-actions {
    display: flex;
    gap: 8px;
}

/* ========================
   Badges / Status
   ======================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 50px;
}

.badge-success {
    background: rgba(0, 217, 165, 0.15);
    color: var(--success);
}

.badge-warning {
    background: rgba(255, 184, 48, 0.15);
    color: var(--warning);
}

.badge-danger {
    background: rgba(255, 71, 87, 0.15);
    color: var(--danger);
}

.badge-info {
    background: rgba(52, 152, 219, 0.15);
    color: var(--info);
}

.badge-muted {
    background: rgba(160, 160, 160, 0.15);
    color: var(--text-muted);
}

/* ========================
   Alerts
   ======================== */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: rgba(0, 217, 165, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-error {
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.alert-warning {
    background: rgba(255, 184, 48, 0.1);
    border: 1px solid var(--warning);
    color: var(--warning);
}

.alert-info {
    background: rgba(52, 152, 219, 0.1);
    border: 1px solid var(--info);
    color: var(--info);
}

/* ========================
   Modal
   ======================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(-20px);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-light);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ========================
   Tabs
   ======================== */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.tab {
    padding: 15px 25px;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.tab:hover {
    color: var(--text-light);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ========================
   Package Selector
   ======================== */
.package-selector {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.package-selector label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
}

.package-selector select {
    width: 100%;
    max-width: 400px;
}

/* ========================
   Usage Bars
   ======================== */
.usage-bar {
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.usage-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.usage-bar-fill.warning {
    background: var(--warning);
}

.usage-bar-fill.danger {
    background: var(--danger);
}

.usage-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 5px;
}

/* ========================
   Announcement Card
   ======================== */
.announcement {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 15px;
    border-left: 3px solid var(--primary);
}

.announcement-title {
    font-weight: 600;
    margin-bottom: 10px;
}

.announcement-date {
    font-size: 0.8rem;
    color: var(--text-dark);
}

.announcement-content {
    color: var(--text-muted);
    margin-top: 10px;
}

/* ========================
   Empty State
   ======================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 4rem;
    opacity: 0.3;
    margin-bottom: 20px;
}

.empty-state-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 10px;
}

/* ========================
   Pagination
   ======================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 30px;
}

.pagination a,
.pagination span {
    padding: 10px 15px;
    background: var(--bg-input);
    border-radius: var(--radius);
    color: var(--text-muted);
}

.pagination a:hover {
    background: var(--border);
    color: var(--text-light);
}

.pagination .active {
    background: var(--primary);
    color: white;
}

/* ========================
   Language Switcher
   ======================== */
.lang-switch {
    display: flex;
    gap: 10px;
}

.lang-switch a {
    padding: 5px 10px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.lang-switch a:hover,
.lang-switch a.active {
    background: var(--primary);
    color: white;
}

/* ========================
   Auth Pages
   ======================== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-box {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: 0 10px 40px var(--shadow);
}

.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo h1 {
    font-size: 1.75rem;
    color: var(--primary);
}

.auth-title {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 10px;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.auth-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid var(--border);
}

/* ========================
   Responsive
   ======================== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .form-inline {
        flex-direction: column;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .table-responsive {
        margin: 0 -20px;
        padding: 0 20px;
    }
}

/* ========================
   Utilities
   ======================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 10px; }
.gap-2 { gap: 20px; }

.hidden { display: none; }
