/* Customer Portal Styles - Dark Theme */

/* Import CSS Variables from Public Theme */
@import url('/style.css');

/* Base Styles */
* {
    box-sizing: border-box;
}

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

/* Navigation */
.customer-nav {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand h2 {
    margin: 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
}

.nav-links a:hover {
    color: var(--text-main);
    text-shadow: 0 0 10px var(--glow-primary);
}

/* Main Content */
main {
    min-height: calc(100vh - 120px);
    padding: 2rem 0;
}

/* Footer */
.customer-footer {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
    color: var(--text-muted);
}

/* Dashboard Container */
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.dashboard-header {
    margin-bottom: 40px;
}

.dashboard-header h1 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 2rem;
}

.dashboard-header p {
    color: #666;
    margin: 0;
    font-size: 1.1rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.dashboard-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 20px var(--glow-primary);
}

.dashboard-card h2 {
    margin: 0 0 20px 0;
    color: var(--text-main);
    font-size: 20px;
}

/* Transaction List */
.transaction-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.transaction-item {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid var(--primary);
    padding-left: 12px;
}

.transaction-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.transaction-info strong {
    color: var(--text-main);
    font-size: 1rem;
}

.transaction-type {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.transaction-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.transaction-amount {
    font-weight: 600;
    color: var(--text-main);
    font-size: 1.1rem;
}

.transaction-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.status-completed {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-draft {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.status-cancelled {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Asset List */
.asset-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.asset-item {
    padding: 20px;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    gap: 15px;
    align-items: center;
    transition: all 0.3s ease;
}

.asset-item:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 15px var(--glow-primary);
}

.asset-icon {
    font-size: 32px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    color: var(--primary);
}

.asset-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.asset-info strong {
    color: var(--text-main);
    font-size: 1.1rem;
}

.asset-info small {
    color: var(--text-muted);
    font-size: 13px;
}

.asset-info .serial {
    font-family: monospace;
    color: var(--text-muted);
    opacity: 0.7;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--bg-dark);
    box-shadow: 0 4px 15px var(--glow-primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--glow-primary);
}

.btn-block {
    width: 100%;
}

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

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

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
    color: var(--text-muted);
}

/* Page Header */
.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    margin: 0 0 10px 0;
    color: var(--text-main);
    font-size: 2rem;
}

.page-header p {
    color: var(--text-muted);
    margin: 0;
}

/* Cards */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 20px var(--glow-primary);
}

.card-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-header h2 {
    margin: 0;
    color: var(--text-main);
    font-size: 1.5rem;
}

/* Invoice List */
.invoice-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.invoice-item {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.invoice-item:last-child {
    border-bottom: none;
}

.invoice-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid var(--primary);
    padding-left: 17px;
}

.invoice-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.invoice-number {
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.1rem;
}

.invoice-date {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.invoice-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.invoice-amount {
    font-weight: 600;
    color: var(--text-main);
    font-size: 1.2rem;
}

/* Warranty Badge */
.warranty-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.warranty-valid {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.warranty-expiring {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.warranty-expired {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .customer-nav {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .nav-brand h2 {
        font-size: 1.25rem;
    }

    .nav-links {
        flex-wrap: wrap;
        gap: 1rem;
        justify-content: center;
        width: 100%;
    }

    .nav-links a {
        padding: 0.5rem 1rem;
        border-radius: 0.5rem;
        background: rgba(255, 255, 255, 0.05);
        min-width: 44px; /* Touch-friendly */
    }

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

    .dashboard-container {
        padding: 20px 15px;
    }

    .dashboard-header h1 {
        font-size: 1.5rem;
    }

    .transaction-item,
    .invoice-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .transaction-details,
    .invoice-details {
        align-items: flex-start;
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
    }

    /* Tables - responsive */
    .table {
        display: block;
        width: 100%;
    }

    .table thead {
        display: none;
    }

    .table tbody,
    .table tr,
    .table td {
        display: block;
        width: 100%;
    }

    .table tr {
        margin-bottom: 1rem;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 0.5rem;
        padding: 1rem;
        background: var(--bg-card);
        backdrop-filter: blur(12px);
    }

    .table td {
        padding: 0.5rem 0;
        text-align: right;
        border: none;
    }

    .table td::before {
        content: attr(data-label);
        font-weight: 600;
        float: left;
        color: var(--text-muted);
    }

    /* Forms */
    .form-control,
    .form-select,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px; /* Prevents zoom on iOS */
        width: 100%;
    }

    /* Cards */
    .dashboard-card {
        padding: 1rem;
    }

    main {
        padding: 1rem 0;
    }
}

@media (max-width: 576px) {
    .customer-nav {
        padding: 0.75rem;
    }

    .nav-links {
        flex-direction: column;
        width: 100%;
    }

    .nav-links a {
        width: 100%;
        text-align: center;
    }

    .dashboard-container {
        padding: 15px 10px;
    }
}

/* Alerts */
.alert {
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 20px;
    backdrop-filter: blur(8px);
}

.alert-error {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-info {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.alert-success {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Table Styles (for invoice details) */
.table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.table th {
    font-weight: 600;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Invoice Detail Styles */
.invoice-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.invoice-detail-info h2 {
    margin: 0 0 10px 0;
    color: var(--text-main);
}

.invoice-detail-amount {
    text-align: right;
}

.invoice-detail-amount .total {
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.invoice-detail-amount .label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

