/**
 * NetDynamic Billing System - Customer Portal Styles
 * Version: 1.1.0-alpha
 * Theme: Dark (Matching NetDynamic Website) with Sidebar Layout
 */

/* CSS Variables - Matching NetDynamic Website Theme */
:root {
    --primary-bg: #0a0a0f;        /* Main background - almost black */
    --secondary-bg: #12121a;      /* Section backgrounds - dark gray-blue */
    --card-bg: #1a1a2e;          /* Card/component backgrounds - medium dark blue */
    --sidebar-bg: #0f0f16;       /* Sidebar background - darker than secondary */
    --accent-purple: #7c3aed;    /* Primary brand color - vibrant purple */
    --accent-blue: #3b82f6;      /* Secondary brand - bright blue */
    --text-primary: #ffffff;     /* Headings and important text - pure white */
    --text-secondary: #a0a0b8;   /* Body text and descriptions - light gray-purple */
    --gradient-primary: linear-gradient(135deg, #7c3aed 0%, #3b82f6 100%);
    --border-color: rgba(124, 58, 237, 0.2);
}

body {
    background: var(--primary-bg);
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-secondary);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

.navbar {
    background: var(--secondary-bg);
    border-bottom: 2px solid var(--border-color);
    padding: 0.75rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 60px;
}

.navbar-container {
    max-width: 1920px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.navbar-brand .logo {
    color: var(--text-primary) !important;
    font-size: 22px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-brand .logo img {
    height: 45px;
    vertical-align: middle;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-user {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 400;
}

.navbar .btn-outline {
    border-color: var(--border-color);
    color: var(--text-primary);
    background: transparent;
}

.navbar .btn-outline:hover {
    background: var(--gradient-primary);
    color: var(--text-primary);
    border-color: var(--accent-purple);
}

/* Sidebar Layout */
.portal-wrapper {
    display: flex;
    min-height: 100vh;
    padding-top: 60px;
    max-width: 1920px;
    margin: 0 auto;
    position: relative;
}

.sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    position: fixed;
    left: 50%;
    margin-left: calc(-1920px / 2);
    top: 60px;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-nav {
    padding: 2rem 0 1rem 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav a i {
    width: 20px;
    margin-right: 12px;
    font-size: 16px;
}

.sidebar-nav a:hover {
    background: rgba(124, 58, 237, 0.1);
    color: var(--text-primary);
    border-left-color: var(--accent-purple);
}

.sidebar-nav a.active {
    background: rgba(124, 58, 237, 0.15);
    color: var(--text-primary);
    border-left-color: var(--accent-purple);
}

.sidebar-nav a.active i {
    color: var(--accent-purple);
}

.main-content {
    margin-left: 250px;
    flex: 1;
    padding: 2.5rem 1.5rem 1.5rem 1.5rem;
    width: 100%;
}

/* Page Header - Smaller and Cleaner */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.page-header h1 {
    font-size: 28px;
    margin: 0;
    color: var(--text-primary);
    font-weight: 700;
}

.page-header h1 i {
    color: var(--accent-purple);
    margin-right: 8px;
}

/* Section Headers - Smaller */
h2 {
    color: var(--text-primary);
    font-size: 18px;
    margin: 1.5rem 0 1rem 0;
    font-weight: 700;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

h3 {
    color: var(--text-primary);
    font-size: 16px;
    margin: 1rem 0 0.75rem 0;
    font-weight: 600;
}

/* Cards - Less Padding */
.card {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.2);
    border-color: rgba(124, 58, 237, 0.4);
}

.card-header {
    background: var(--secondary-bg);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 8px 8px 0 0;
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    font-size: 15px;
}

.card-header i {
    margin-right: 6px;
    color: var(--accent-purple);
}

.card-body {
    padding: 1rem;
}

/* Info Box - Compact User Info */
.info-box {
    background: var(--secondary-bg);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.info-box-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.75rem;
}

.info-box-header i {
    color: var(--accent-purple);
    font-size: 20px;
}

.info-box-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--text-primary);
}

.info-box-content {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.info-box-content strong {
    color: var(--text-primary);
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.service-card {
    background: var(--secondary-bg);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.service-card:hover {
    border-color: var(--accent-purple);
    box-shadow: 0 2px 10px rgba(124, 58, 237, 0.2);
}

.service-name {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 0.5rem;
}

.service-name i {
    color: var(--accent-purple);
    margin-right: 6px;
}

.service-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
}

.service-amount {
    color: var(--accent-purple);
    font-weight: 700;
    font-size: 16px;
}

.service-date {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    border-left: 4px solid;
    background: rgba(124, 58, 237, 0.1);
    font-size: 14px;
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    border-color: #22c55e;
    color: #86efac;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    color: #fca5a5;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border-color: #f59e0b;
    color: #fde047;
}

.table-responsive {
    overflow-x: auto;
    border-radius: 8px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table thead {
    background: var(--secondary-bg);
}

.table thead th {
    padding: 0.75rem 0.75rem;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
}

.table tbody td {
    padding: 0.75rem 0.75rem;
    border-bottom: 1px solid rgba(124, 58, 237, 0.1);
    color: var(--text-primary);
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background: rgba(124, 58, 237, 0.05);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table a {
    color: var(--accent-purple);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.table a:hover {
    color: var(--accent-blue);
    text-decoration: underline;
}

.table .btn-primary {
    color: var(--text-primary);
}

.table .btn-primary:hover {
    color: var(--text-primary);
}

.btn {
    padding: 0.5rem 0.9rem;
    border-radius: 6px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    cursor: pointer;
}

.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 12px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--text-primary);
    border: none;
}

.btn-primary:hover {
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--gradient-primary);
    border-color: var(--accent-purple);
    color: var(--text-primary);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

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

.btn-secondary:hover {
    background: var(--card-bg);
    border-color: var(--accent-purple);
}

.badge {
    padding: 0.3rem 0.65rem;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-success {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fde047;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.badge-info {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-secondary);
}

.actions {
    white-space: nowrap;
}

.actions .btn {
    margin-right: 0.5rem;
}

.actions .btn:last-child {
    margin-right: 0;
}

.empty-state {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 42px;
    color: rgba(124, 58, 237, 0.3);
    margin-bottom: 0.75rem;
    display: block;
}

/* Credit Card Display */
.card-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.credit-card {
    background: var(--gradient-primary);
    border-radius: 12px;
    padding: 1.25rem;
    position: relative;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.credit-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.credit-card-brand {
    font-size: 18px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
}

.credit-card-default {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.credit-card-number {
    font-size: 16px;
    font-weight: 600;
    color: white;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.credit-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.credit-card-expiry {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
}

.credit-card-actions {
    display: flex;
    gap: 0.5rem;
}

/* Invoice view page styles */
.invoice-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 1rem;
}

.invoice-logo h1 {
    margin: 0;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.invoice-number {
    text-align: right;
}

.invoice-number h2 {
    margin: 0;
    font-size: 32px;
    color: var(--text-primary);
}

.invoice-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.invoice-table {
    width: 100%;
    margin-bottom: 30px;
}

.invoice-totals {
    margin-left: auto;
    width: 300px;
}

/* Print styles */
@media print {
    .no-print {
        display: none;
    }

    .navbar, .sidebar {
        display: none;
    }

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

    body {
        background: white;
        color: black;
    }

    .card {
        background: white;
        border: 1px solid #ddd;
        box-shadow: none;
    }

    .card-header {
        background: #f8f9fa !important;
        color: black !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    h1, h2, .table thead th, .table tbody td {
        color: black !important;
    }
}

/* Responsive */
@media (max-width: 1920px) {
    .sidebar {
        left: 0;
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0.75rem 1rem;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        left: 0;
        margin-left: 0;
    }

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

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .page-header h1 {
        font-size: 22px;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .invoice-details {
        grid-template-columns: 1fr;
    }

    .invoice-totals {
        width: 100%;
    }
}
