/**
 * CV. Hidup Berkah Mandiri
 * Main Stylesheet
 * Color scheme derived from logo: Green to Cyan gradient
 */

/* ============================================
   CSS VARIABLES (BRAND COLORS)
   ============================================ */
:root {
    /* Primary Colors */
    --primary-green: #2E8B57;
    --primary-blue: #00BFFF;
    --primary-gradient: linear-gradient(135deg, #2E8B57 0%, #00BFFF 100%);
    --primary-gradient-hover: linear-gradient(135deg, #247048 0%, #00a8e0 100%);

    /* Secondary Colors */
    --secondary-dark: #1a1a2e;
    --secondary-gray: #6c757d;
    --secondary-light: #e9ecef;

    /* Background Colors */
    --bg-body: #f4f6f9;
    --bg-card: #ffffff;
    --bg-sidebar: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);

    /* Text Colors */
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-light: #ffffff;
    --text-muted: #adb5bd;

    /* Status Colors */
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Sidebar Width */
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
}

/* ============================================
   BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-green);
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--text-light);
    box-shadow: 0 4px 15px rgba(46, 139, 87, 0.3);
}

.btn-primary:hover {
    background: var(--primary-gradient-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 139, 87, 0.4);
    color: var(--text-light);
}

.btn-secondary {
    background-color: var(--secondary-gray);
    color: var(--text-light);
}

.btn-secondary:hover {
    background-color: #5a6268;
    color: var(--text-light);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-green);
    color: var(--primary-green);
}

.btn-outline:hover {
    background: var(--primary-gradient);
    color: var(--text-light);
    border-color: transparent;
}

.btn-success {
    background-color: var(--success);
    color: var(--text-light);
}

.btn-danger {
    background-color: var(--danger);
    color: var(--text-light);
}

.btn-warning {
    background-color: var(--warning);
    color: var(--text-primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    border: 1px solid var(--secondary-light);
    border-radius: var(--radius-sm);
    background-color: var(--bg-card);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(46, 139, 87, 0.15);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236c757d' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check-input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-green);
}

.form-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.invalid-feedback {
    color: var(--danger);
    font-size: 12px;
    margin-top: 4px;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: none;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 1rem 1.25rem;
    background: transparent;
    border-bottom: 1px solid var(--secondary-light);
    font-weight: 600;
}

.card-header.gradient {
    background: var(--primary-gradient);
    color: var(--text-light);
    border-bottom: none;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    padding: 1rem 1.25rem;
    background: var(--bg-body);
    border-top: 1px solid var(--secondary-light);
}

/* ============================================
   STAT CARDS (DASHBOARD)
   ============================================ */
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: var(--primary-gradient);
    color: var(--text-light);
    margin-bottom: 1rem;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.stat-card.green::before {
    background: var(--primary-green);
}

.stat-card.blue::before {
    background: var(--primary-blue);
}

.stat-card.success::before {
    background: var(--success);
}

.stat-card.warning::before {
    background: var(--warning);
}

.stat-card.info::before {
    background: #17a2b8;
}

.stat-card.secondary::before {
    background: #6c757d;
}

/* ============================================
   TABLES
   ============================================ */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--secondary-light);
}

.table th {
    background: var(--bg-body);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr:hover {
    background-color: rgba(46, 139, 87, 0.05);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background-color: rgba(40, 167, 69, 0.15);
    color: var(--success);
}

.badge-warning {
    background-color: rgba(255, 193, 7, 0.15);
    color: #d39e00;
}

.badge-danger {
    background-color: rgba(220, 53, 69, 0.15);
    color: var(--danger);
}

.badge-info {
    background-color: rgba(23, 162, 184, 0.15);
    color: var(--info);
}

.badge-primary {
    background: var(--primary-gradient);
    color: var(--text-light);
}

.badge-secondary {
    background-color: var(--secondary-light);
    color: var(--text-secondary);
}

/* Package badges */
.badge-silver {
    background: linear-gradient(135deg, #b0b0b0 0%, #d4d4d4 100%);
    color: #fff;
}

.badge-gold {
    background: linear-gradient(135deg, #d4a00f 0%, #f4d03f 100%);
    color: #fff;
}

.badge-platinum {
    background: linear-gradient(135deg, #6b7280 0%, #9ca3af 50%, #6b7280 100%);
    color: #fff;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    z-index: 1000;
    transition: all var(--transition-normal);
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    width: 80px;
    height: auto;
    margin-bottom: 10px;
}

.sidebar-brand {
    color: var(--text-light);
    font-size: 14px;
    font-weight: 600;
}

.sidebar-menu {
    padding: 1rem 0;
}

.menu-label {
    padding: 0.75rem 1.5rem 0.5rem;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: rgba(255, 255, 255, 0.7);
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
}

.menu-item:hover {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.05);
    border-left-color: var(--primary-green);
}

.menu-item.active {
    color: var(--text-light);
    background: rgba(46, 139, 87, 0.2);
    border-left-color: var(--primary-green);
}

.menu-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: all var(--transition-normal);
}

.topbar {
    background: var(--bg-card);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-title {
    font-size: 18px;
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-dropdown {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.user-dropdown:hover {
    background: var(--bg-body);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-weight: 600;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.user-info {
    text-align: right;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: var(--text-secondary);
}

.content-wrapper {
    padding: 1.5rem;
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    padding: 2rem;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
}

.login-logo {
    width: 120px;
    margin: 0 auto 1.5rem;
    display: block;
}

.login-title {
    text-align: center;
    font-size: 24px;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.login-form .btn-primary {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    margin-top: 1rem;
}

/* ============================================
   WALLET DISPLAY
   ============================================ */
.wallet-balance {
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    padding: 2rem;
    color: var(--text-light);
    position: relative;
    overflow: hidden;
}

.wallet-balance::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(30deg);
}

.wallet-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.wallet-amount {
    font-size: 36px;
    font-weight: 700;
}

.wallet-code {
    margin-top: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    letter-spacing: 2px;
}

/* ============================================
   REFERRAL CODE DISPLAY
   ============================================ */
.referral-code-display {
    background: var(--bg-body);
    border: 2px dashed var(--primary-green);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
}

.referral-code-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.referral-code {
    font-family: 'Courier New', monospace;
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-green);
    letter-spacing: 4px;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    border-left: 4px solid var(--success);
    color: var(--success);
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    border-left: 4px solid var(--danger);
    color: var(--danger);
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    border-left: 4px solid var(--warning);
    color: #856404;
}

.alert-info {
    background-color: rgba(23, 162, 184, 0.1);
    border-left: 4px solid var(--info);
    color: var(--info);
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress {
    height: 8px;
    background-color: var(--secondary-light);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 4px;
    transition: width var(--transition-normal);
}

/* ============================================
   SKELETON LOADING
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, var(--secondary-light) 25%, #e9ecef 50%, var(--secondary-light) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
}

.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: all var(--transition-fast);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--secondary-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    line-height: 1;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--secondary-light);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .stat-card .stat-value {
        font-size: 22px;
    }

    .wallet-amount {
        font-size: 28px;
    }

    .content-wrapper {
        padding: 1rem;
    }

    .topbar {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .login-card {
        padding: 1.5rem;
    }

    .table th,
    .table td {
        padding: 10px 12px;
    }
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--text-secondary);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mt-5 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mb-5 {
    margin-bottom: 2rem;
}

.p-3 {
    padding: 1rem;
}

.p-4 {
    padding: 1.5rem;
}

.d-flex {
    display: flex;
}

.align-items-center {
    align-items: center;
}

.justify-content-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 1rem;
}

.w-100 {
    width: 100%;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: -0.75rem;
}

.col {
    flex: 1;
    padding: 0.75rem;
}

.col-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0.75rem;
}

.col-4 {
    flex: 0 0 33.333%;
    max-width: 33.333%;
    padding: 0.75rem;
}

.col-3 {
    flex: 0 0 25%;
    max-width: 25%;
    padding: 0.75rem;
}

.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0.75rem;
}

@media (min-width: 992px) {
    .col-lg-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }

    .col-lg-4 {
        flex: 0 0 33.333%;
        max-width: 33.333%;
    }

    .col-lg-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .col-lg-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .col-md-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

@media (max-width: 576px) {

    .col-6,
    .col-4,
    .col-3,
    .col {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Responsive Display Utilities */
.desktop-only {
    display: flex !important;
}

.mobile-only {
    display: none !important;
}

@media (max-width: 992px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: flex !important;
    }
}
