:root {
    --sidebar-width: 250px;
    --header-height: 70px;
}

body {
    background-color: var(--background-color);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Side Panel */
.side-panel {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(150deg, var(--primary-dark) 0%, #002147 100%);
    color: white;
    padding: 1.5rem 0;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s ease;
}

/* Bank Logo */
.bank-logo {
    text-align: center;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bank-logo h1 {
    color: white;
    font-size: 1.5rem;
    margin: 0;
    letter-spacing: -0.5px;
}

/* Navigation Links */
.side-panel nav {
    padding: 0 1rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.nav-link:before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background-color: var(--secondary-color);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    padding-left: 1.5rem;
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
}

.nav-link.active:before {
    opacity: 1;
}

.nav-link-icon {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    opacity: 0.8;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 1.5rem 2rem;
    max-width: 1400px;
}

/* Greeting Section with Balance Card */
.greeting-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1.5rem;
}

.greeting-text h1 {
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
    font-size: 2rem;
}

.greeting-text p {
    margin: 0;
    color: var(--text-light);
}

.account-card {
    background: linear-gradient(140deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 15px;
    padding: 1.5rem;
    color: white;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    min-width: 280px;
    position: relative;
    overflow: hidden;
}

.account-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
    transform: rotate(30deg);
    pointer-events: none;
}

.account-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.account-balance {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.account-number-display {
    font-size: 0.9rem;
    opacity: 0.8;
    letter-spacing: 1px;
}

/* Quick Actions Row */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.action-card {
    background-color: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.action-icon {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    height: 50px;
    width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 84, 166, 0.1);
    border-radius: 12px;
}

.action-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 600;
}

.action-description {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    flex-grow: 1;
}

/* Profile Section */
.profile-section {
    background-color: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    text-align: center;
}

.profile-picture-wrapper {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 1rem;
}

.profile-picture {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary-color);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.profile-picture-edit {
    position: absolute;
    right: 0;
    bottom: 0;
    background: var(--primary-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.profile-picture-edit:hover {
    background: var(--primary-dark);
}

.upload-form {
    margin: 1rem auto;
    max-width: 300px;
}

/* Sections */
.dashboard-section {
    background-color: white;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    font-size: 1.3rem;
    margin: 0;
    color: var(--text-color);
    font-weight: 600;
}

/* Transaction styling */
.transaction-item {
    border-left: 4px solid transparent;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    background-color: #fafafa;
    transition: transform 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.transaction-item:hover {
    transform: translateX(5px);
}

.transaction-details {
    display: flex;
    flex-direction: column;
}

.transaction-account {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.3rem;
}

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

.transaction-description {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 0.25rem;
    font-style: italic;
}

.transaction-amount {
    font-size: 1.1rem;
    font-weight: 600;
}

.transaction-item.sent {
    border-left-color: var(--danger-color);
}

.transaction-amount.sent {
    color: var(--danger-color);
}

.transaction-item.received {
    border-left-color: var(--success-color);
}

.transaction-amount.received {
    color: var(--success-color);
}

/* Forms */
.form-section {
    padding: 0;
    border: none;
    box-shadow: none;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    flex: 1;
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #fafafa;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    background-color: white;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 84, 166, 0.1);
}

/* Virtual cards */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.virtual-card {
    background: linear-gradient(125deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
    min-height: 180px;
}

.virtual-card::before {
    content: "";
    position: absolute;
    right: -20px;
    top: -20px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    z-index: 1;
}

.card-type {
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.card-number {
    font-size: 1.2rem;
    letter-spacing: 2px;
    margin: 1rem 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
}

.card-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-top: 1rem;
    opacity: 0.8;
    position: relative;
    z-index: 2;
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
    position: relative;
    z-index: 2;
}

.card-actions button {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.card-actions button:hover {
    background-color: rgba(255, 255, 255, 0.25);
}

.virtual-card.frozen {
    opacity: 0.7;
}

/* Modal styling */
.modal {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

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

.modal-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.2s ease;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 200;
    background-color: var(--primary-color);
    color: white;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s ease;
}

.menu-toggle:hover {
    background-color: var(--primary-dark);
}

/* Payment items */
.payment-item {
    background-color: white;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--secondary-color);
}

.payment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

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

.payment-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    background-color: #e8f5e9;
    color: var(--success-color);
    font-weight: 500;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .greeting-section {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .account-card {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .side-panel {
        transform: translateX(-100%);
        z-index: 1000;
    }
    
    .side-panel.active {
        transform: translateX(0);
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}


/* ===== CUSTOMER SUPPORT CHAT WIDGET ===== */

.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Chat Toggle Button */
.chat-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
    position: relative;
    border: none;
}

.chat-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(0, 123, 255, 0.4);
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Chat Window */
.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e1e8ed;
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.agent-avatar {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.agent-details {
    line-height: 1.2;
}

.agent-name {
    font-weight: 600;
    font-size: 14px;
}

.agent-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
}

.agent-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    display: inline-block;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 80%;
}

.message.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bot-message .message-avatar {
    background: var(--primary-color);
    color: white;
}

.user-message .message-avatar {
    background: #6c757d;
    color: white;
}

.message-content {
    flex: 1;
}

.message-text {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.user-message .message-text {
    background: var(--primary-color);
    color: white;
}

.message-time {
    font-size: 11px;
    color: #6c757d;
    margin-top: 4px;
    padding: 0 4px;
}

/* Chat Input */
.chat-input {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e1e8ed;
}

.input-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

#chatMessageInput {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e1e8ed;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

#chatMessageInput:focus {
    border-color: var(--primary-color);
}

#sendChatBtn {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

#sendChatBtn:hover {
    background: var(--primary-dark);
}

#sendChatBtn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 12px;
    color: #6c757d;
}

.typing-dots {
    display: flex;
    gap: 2px;
}

.typing-dots span {
    width: 4px;
    height: 4px;
    background: #6c757d;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Responsive Chat Widget */
@media (max-width: 768px) {
    .chat-window {
        width: calc(100vw - 40px);
        height: 70vh;
        right: -10px;
    }
    
    .chat-toggle {
        width: 55px;
        height: 55px;
    }
}

/* Animation for opening/closing */
.chat-window.opening {
    animation: chatOpen 0.3s ease-out;
}

.chat-window.closing {
    animation: chatClose 0.3s ease-in;
}

@keyframes chatOpen {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes chatClose {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
}

/* Chat Mode Toggle */
.chat-mode-toggle {
    background: #f8f9fa;
    border-bottom: 1px solid #e1e8ed;
    padding: 12px 20px;
}

.mode-selector {
    display: flex;
    gap: 15px;
}

.mode-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #6c757d;
    transition: color 0.2s ease;
}

.mode-option input[type="radio"] {
    margin: 0;
    accent-color: var(--primary-color);
}

.mode-option:has(input:checked) {
    color: var(--primary-color);
    font-weight: 500;
}

.mode-option span {
    user-select: none;
}

/* Chat Tooltip */
.chat-tooltip {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    z-index: 1001;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.chat-tooltip::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-left-color: rgba(0, 0, 0, 0.8);
}

.chat-toggle:hover .chat-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(-5px);
}

/* Hide tooltip when chat is open */
.chat-widget.chat-open .chat-tooltip {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Mobile responsive tooltip */
@media (max-width: 768px) {
    .chat-tooltip {
        right: 65px;
        font-size: 11px;
        padding: 6px 10px;
    }
}
