/* ===============================
   USER COMPONENTS STYLES
   Comprehensive styling for Transfer funds, Accounts, Profile, and Settings
   =============================== */

/* ===============================
   ADMIN USER VIEW HEADER STYLES
   =============================== */
.admin-user-view-header {
    margin-bottom: 2rem;
    padding: 1rem 0;
    border-bottom: 2px solid #e9ecef;
}

.breadcrumb-nav {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.breadcrumb-item {
    color: #495057;
}

.breadcrumb-item.active {
    color: #007bff;
    font-weight: 600;
}

.breadcrumb-separator {
    margin: 0 0.5rem;
    color: #dee2e6;
}

.view-context-badge {
    display: flex;
    gap: 0.5rem;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge.admin-context {
    background-color: #dc3545;
    color: white;
}

.badge.user-view {
    background-color: #007bff;
    color: white;
}

/* User View Badge for Sidebar */
.user-view-badge {
    font-size: 10px !important;
    background: #007bff !important;
    color: white !important;
    padding: 2px 6px !important;
    border-radius: 10px !important;
    margin-left: 8px !important;
    font-weight: 500 !important;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* ===============================
   COMMON COMPONENT STYLES
   =============================== */
.user-component {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 0.5s ease-out;
}

.component-header {
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f1f3f4;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
}

.component-header h2 {
    margin: 0;
    color: #1a1a1a;
    font-size: 1.8em;
    font-weight: 600;
}

.component-header p {
    margin: 8px 0 0 0;
    color: #666;
    font-size: 1.1em;
}

.header-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ===============================
   FORM STYLES
   =============================== */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.help-text {
    margin-top: 4px;
    font-size: 12px;
    color: #666;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e1e5e9;
}

.amount-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-symbol {
    position: absolute;
    left: 12px;
    font-weight: 600;
    color: #666;
    z-index: 1;
}

.amount-input-container input {
    padding-left: 28px;
}

/* ===============================
   BUTTON STYLES
   =============================== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    text-align: center;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.btn-secondary:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-xs {
    padding: 4px 8px;
    font-size: 11px;
}

/* ===============================
   TRANSFER FUNDS COMPONENT
   =============================== */
.transfer-form-container {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
}

.transfer-summary {
    background: white;
    border: 2px solid #e1f5fe;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
}

.transfer-summary h4 {
    margin: 0 0 12px 0;
    color: #1976d2;
}

.summary-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
}

.summary-row.total {
    border-top: 1px solid #e1e5e9;
    padding-top: 8px;
    margin-top: 8px;
    font-weight: 600;
    color: #1976d2;
}

.recent-transfers {
    margin-top: 32px;
}

.recent-transfers h3 {
    margin-bottom: 16px;
    color: #333;
}

.transfers-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.transfer-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.transfer-info {
    flex: 1;
}

.transfer-accounts {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.transfer-arrow {
    color: #667eea;
    font-weight: 600;
}

.transfer-amount {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.transfer-details {
    text-align: right;
}

.transfer-date {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.no-transfers {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 24px;
}

/* ===============================
   ACCOUNTS COMPONENT
   =============================== */
.accounts-overview {
    margin-bottom: 32px;
}

.total-balance-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}

.total-balance-card h3 {
    margin: 0 0 8px 0;
    font-size: 1.2em;
    opacity: 0.9;
}

.total-amount {
    font-size: 2.5em;
    font-weight: 700;
    margin: 8px 0;
}

.balance-breakdown {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 16px;
    opacity: 0.9;
}

.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.account-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-left: 4px solid #667eea;
}

.account-card.trading {
    border-left-color: #2196f3;
}

.account-card.savings {
    border-left-color: #4caf50;
}

.account-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.account-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.account-type {
    font-weight: 600;
    color: #333;
}

.account-number {
    font-family: 'Courier New', monospace;
    color: #666;
    margin-bottom: 16px;
    font-size: 14px;
}

.account-balance {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}

.balance-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.balance-amount {
    font-size: 1.6em;
    font-weight: 700;
    color: #333;
}

.account-actions {
    display: flex;
    gap: 8px;
}

.accounts-table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.accounts-table-container h3 {
    margin: 0;
    padding: 20px 24px 0 24px;
    color: #333;
}

.table-controls {
    padding: 16px 24px;
    background: #f8f9fa;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.table-controls input,
.table-controls select {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
}

.accounts-table {
    width: 100%;
    border-collapse: collapse;
}

.accounts-table th,
.accounts-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e1e5e9;
}

.accounts-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
    z-index: 1;
}

.accounts-table tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

.action-buttons {
    display: flex;
    gap: 4px;
}

/* ===============================
   PROFILE COMPONENT
   =============================== */
.profile-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 2px solid #e1e5e9;
    overflow-x: auto;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-btn:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.profile-content {
    position: relative;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.tab-content.active {
    display: block;
}

.profile-form {
    max-width: 800px;
}

.form-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e1e5e9;
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h3 {
    margin: 0 0 16px 0;
    color: #333;
    font-size: 1.3em;
}

.security-settings {
    max-width: 800px;
}

.security-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e1e5e9;
}

.security-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 16px;
}

.security-info h4 {
    margin: 0 0 4px 0;
    color: #333;
}

.security-info p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.verification-status {
    max-width: 800px;
}

.verification-overview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.verification-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
}

.verification-badge.verified {
    background: #d4edda;
    color: #155724;
}

.verification-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.verification-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.step.completed {
    background: #d4edda;
}

.step-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.step.completed .step-icon {
    background: #28a745;
    color: white;
}

.step.pending .step-icon {
    background: #ffc107;
    color: white;
}

.step-content h4 {
    margin: 0 0 4px 0;
    color: #333;
}

.step-content p {
    margin: 0 0 8px 0;
    color: #666;
}

.documents-section {
    max-width: 800px;
}

.documents-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.documents-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.document-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.document-info h4 {
    margin: 0 0 4px 0;
    color: #333;
}

.document-info p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.document-actions {
    display: flex;
    gap: 8px;
}

.no-documents {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 48px 24px;
}

/* ===============================
   SETTINGS COMPONENT
   =============================== */
.settings-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 2px solid #e1e5e9;
    overflow-x: auto;
}

.settings-content {
    position: relative;
}

.settings-form {
    max-width: 800px;
}

.settings-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e1e5e9;
}

.settings-section:last-child {
    border-bottom: none;
}

.settings-section h3 {
    margin: 0 0 16px 0;
    color: #333;
    font-size: 1.3em;
}

.setting-item {
    margin-bottom: 16px;
}

.setting-item label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    display: block;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

.checkbox-item label {
    margin: 0;
    cursor: pointer;
}

.privacy-settings {
    max-width: 800px;
}

.privacy-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 16px;
}

.privacy-item h4 {
    margin: 0 0 4px 0;
    color: #333;
}

.privacy-item p {
    margin: 0;
    color: #666;
}

.api-settings {
    max-width: 800px;
}

.api-key-section {
    margin-bottom: 24px;
}

.api-key-display {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.api-key-display input {
    flex: 1;
    font-family: 'Courier New', monospace;
}

.api-actions {
    display: flex;
    gap: 12px;
}

.usage-stats {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
}

.usage-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e1e5e9;
}

.usage-item:last-child {
    border-bottom: none;
}

/* ===============================
   STATUS STYLES
   =============================== */
.status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-failed {
    background: #f8d7da;
    color: #721c24;
}

.document-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.document-status.approved {
    background: #d4edda;
    color: #155724;
}

.document-status.pending {
    background: #fff3cd;
    color: #856404;
}

.document-status.rejected {
    background: #f8d7da;
    color: #721c24;
}

/* ===============================
   RESPONSIVE DESIGN
   =============================== */
@media (max-width: 768px) {
    .user-component {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    .component-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .accounts-grid {
        grid-template-columns: 1fr;
    }
    
    .total-amount {
        font-size: 2em;
    }
    
    .balance-breakdown {
        flex-direction: column;
        gap: 8px;
    }
    
    .transfer-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .transfer-details {
        text-align: left;
        width: 100%;
    }
    
    .security-item,
    .privacy-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .document-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .api-key-display {
        flex-direction: column;
    }
    
    .table-controls {
        flex-direction: column;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .profile-tabs,
    .settings-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .verification-overview {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .usage-item {
        flex-direction: column;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .tab-btn {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .accounts-table-container {
        overflow-x: auto;
    }
    
    .accounts-table {
        min-width: 600px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .total-amount {
        font-size: 1.8em;
    }
}

/* ===============================
   ANIMATIONS
   =============================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ===============================
   LOADING STATES
   =============================== */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
}

.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    border: 2px solid #667eea;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}
