/* Premium Light Theme Color Palette & CSS Variables */
:root {
    --bg-light: #f3f4f6;
    --card-bg: rgba(255, 255, 255, 0.75);
    --border-color: rgba(99, 102, 241, 0.1);
    --text-primary: #1e1b4b; /* Deep Indigo Charcoal */
    --text-secondary: #4f46e5; /* Indigo */
    --text-muted: #6b7280; /* Soft gray */
    --primary: #4f46e5; /* Royal Indigo */
    --primary-glow: rgba(79, 70, 229, 0.12);
    --accent: #818cf8; /* Light Indigo */
    --success: #059669; /* Deep Emerald */
    --success-bg: rgba(5, 150, 105, 0.08);
    --danger: #dc2626; /* Crimson Red */
    --warning: #d97706;
    --font-main: 'Plus Jakarta Sans', sans-serif;
    --font-heading: 'Outfit', sans-serif;
}

/* Base resets & styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-light);
    color: var(--text-primary);
    font-family: var(--font-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    background-image: 
        radial-gradient(at 0% 0%, rgba(129, 140, 248, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(244, 63, 94, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(16, 185, 129, 0.06) 0px, transparent 50%);
}

/* Background decorative glowing circles (soft pastels) */
.bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    opacity: 0.5;
}
.bg-glow-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, transparent 70%);
    top: -150px;
    right: -100px;
}
.bg-glow-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.1) 0%, transparent 70%);
    bottom: -200px;
    left: -200px;
}

/* Glassmorphism utility card */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.04), 0 1px 8px rgba(0, 0, 0, 0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Toast System */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-left: 4px solid var(--primary);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 14px 20px;
    border-radius: 10px;
    min-width: 280px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--accent); }

@keyframes slideIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Login Screen Layout */
#login-screen {
    max-width: 440px;
    margin: 140px auto;
    padding: 45px 35px;
    text-align: center;
    display: none;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
#login-screen.active {
    display: block;
    transform: scale(1);
    opacity: 1;
}
.login-header .logo-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 32px;
    color: #fff;
    box-shadow: 0 10px 20px var(--primary-glow);
}
.login-header h2 {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 10px;
    color: var(--text-primary);
}
.login-header p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 30px;
}

/* Input design */
.input-group {
    position: relative;
    margin-bottom: 24px;
}
.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 16px;
}
.input-group input {
    width: 100%;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 15px 15px 15px 48px;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    outline: none;
    transition: all 0.3s;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.01);
}
.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
    background: #fff;
}

/* Button design */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn:active {
    transform: scale(0.96);
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #312e81 100%);
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}
.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
    filter: brightness(1.05);
}
.btn-secondary {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: var(--text-primary);
}
.btn-secondary:hover {
    background: #f9fafb;
    border-color: var(--primary);
}
.btn-full {
    width: 100%;
    padding: 15px;
}

/* Dashboard Layout */
#main-dashboard {
    max-width: 1280px;
    margin: 40px auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
#main-dashboard.dashboard-visible {
    opacity: 1;
    transform: translateY(0);
}
.dashboard-hidden {
    display: none !important;
}

/* Header UI */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px;
}
.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
.header-left h1 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
}
.logo-small {
    width: 44px;
    height: 44px;
    font-size: 20px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.badge {
    background: rgba(79, 70, 229, 0.08);
    border: 1px solid rgba(79, 70, 229, 0.2);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Stats Layout */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.stat-card {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.stat-info h3 {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 6px;
}
.stat-value {
    font-family: var(--font-heading);
    font-size: 36px;
    font-weight: 800;
    color: var(--text-primary);
}
.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}
.stat-icon.purple {
    background: rgba(79, 70, 229, 0.08);
    color: var(--primary);
}
.stat-icon.green {
    background: rgba(5, 150, 105, 0.08);
    color: var(--success);
}

/* Controls Bar */
.workspace-card {
    padding: 28px;
}
.controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 15px;
}
.search-wrapper {
    position: relative;
    flex-grow: 1;
    max-width: 420px;
}
.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}
.search-wrapper input {
    width: 100%;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 12px 15px 12px 42px;
    border-radius: 10px;
    color: var(--text-primary);
    outline: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}
.search-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Desktop Accounts Table UI */
.table-wrapper {
    overflow-x: auto;
}
.desktop-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}
.desktop-table th {
    padding: 14px 18px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.04);
}
.desktop-table td {
    padding: 16px 18px;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 1px solid rgba(0, 0, 0, 0.02);
    vertical-align: middle;
}
.desktop-table tbody tr:hover {
    background: rgba(79, 70, 229, 0.015);
}

/* Interactive elements inside table/card */
.copyable {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 6px 12px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.2s;
    user-select: none;
    max-width: 100%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.01);
}
.copyable:hover {
    background: rgba(79, 70, 229, 0.08);
    border-color: var(--primary);
}
.copyable:active {
    transform: scale(0.95);
}
.copy-icon {
    font-size: 11px;
    color: var(--text-muted);
}
.copyable:hover .copy-icon {
    color: var(--primary);
}

/* Password eye toggler utility */
.pass-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.eye-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    transition: color 0.2s;
}
.eye-btn:hover {
    color: var(--primary);
}

/* OTP Badge with timer */
.otp-display-group {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}
.otp-badge {
    background: var(--success-bg);
    border: 1px solid rgba(5, 150, 105, 0.2);
    color: var(--success);
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.04);
}
.otp-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.15);
    background: rgba(5, 150, 105, 0.12);
}
.otp-badge:active {
    transform: translateY(0) scale(0.95);
}

/* Circular Timer Graphic */
.timer-ring {
    position: relative;
    width: 22px;
    height: 22px;
}
.timer-ring svg {
    transform: rotate(-90deg);
    width: 22px;
    height: 22px;
}
.timer-ring circle {
    fill: none;
    stroke-width: 2.8;
}
.timer-ring-bg {
    stroke: rgba(0, 0, 0, 0.05);
}
.timer-ring-progress {
    stroke: var(--success);
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}
.timer-ring.warning .timer-ring-progress {
    stroke: var(--danger);
}

/* Expandable field text */
.truncated-text {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}

/* Notes, Email rendering styling */
.note-text {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}

/* Actions cell */
.actions-cell {
    display: flex;
    gap: 8px;
    justify-content: center;
}
.btn-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: #fff;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}
.btn-icon:hover {
    color: var(--text-primary);
}
.btn-icon.edit:hover {
    background: rgba(79, 70, 229, 0.08);
    border-color: var(--primary);
    color: var(--primary);
}
.btn-icon.delete:hover {
    background: rgba(220, 38, 38, 0.08);
    border-color: var(--danger);
    color: var(--danger);
}

/* Empty State styling */
.empty-state {
    text-align: center;
    padding: 70px 20px;
    color: var(--text-muted);
}
.empty-icon {
    font-size: 54px;
    margin-bottom: 18px;
    color: rgba(79, 70, 229, 0.15);
}
.empty-state.hidden {
    display: none;
}

/* Mobile responsive card list */
.mobile-accounts-list {
    display: none;
    flex-direction: column;
    gap: 16px;
}
.mobile-account-card {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.05);
}
.card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.card-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}
.card-header-title {
    font-weight: 800;
    color: var(--text-primary);
    font-size: 16px;
    font-family: var(--font-heading);
}

/* Modal styling */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal.active {
    display: flex;
}
.modal-content {
    width: 100%;
    max-width: 620px;
    padding: 28px;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    animation: modalShow 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes modalShow {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    padding-bottom: 12px;
}
.modal-header h2 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
}
.close-modal-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
}
.close-modal-btn:hover {
    color: var(--text-primary);
}
.modal-body textarea {
    width: 100%;
    height: 190px;
    background: #f9fafb;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    padding: 14px;
    color: var(--text-primary);
    font-family: monospace;
    font-size: 13px;
    resize: none;
    outline: none;
    margin-bottom: 16px;
    transition: all 0.2s;
}
.modal-body textarea:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.help-text {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.help-text code {
    background: rgba(79, 70, 229, 0.08);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-weight: 600;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Forms layout inside edit modal */
.form-group {
    margin-bottom: 18px;
}
.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 6px;
    font-weight: 700;
}
.form-group input, .form-group textarea {
    width: 100%;
    background: #f9fafb;
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 11px 14px;
    border-radius: 10px;
    color: var(--text-primary);
    outline: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}
.form-group input:focus, .form-group textarea:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Import Live Preview UI */
.preview-section {
    margin-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    padding-top: 15px;
}
.preview-section h3 {
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-weight: 700;
}
.preview-table-wrapper {
    max-height: 160px;
    overflow-y: auto;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 10px;
}
.preview-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 12px;
}
.preview-table th, .preview-table td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}
.preview-table th {
    background: #f9fafb;
    color: var(--text-muted);
    font-weight: 700;
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
    #main-dashboard {
        margin: 20px auto;
        padding: 0 12px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .stat-card {
        padding: 18px 22px;
    }
    .stat-value {
        font-size: 30px;
    }
    .controls-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .search-wrapper {
        max-width: 100%;
    }
    .table-wrapper {
        display: none;
    }
    .mobile-accounts-list {
        display: flex;
    }
    .workspace-card {
        padding: 18px;
    }
    .header {
        padding: 15px 20px;
    }
    .header-left h1 {
        font-size: 20px;
    }
    .modal-content {
        padding: 20px;
    }
}
