/* Base Styles */
:root {
    --primary-color: #4a6fa5;
    --secondary-color: #166088;
    --accent-color: #4fc3dc;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --gray-color: #6c757d;
    --light-gray: #e9ecef;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: #f5f7fa;
    color: var(--dark-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Typography */
h1, h2, h3, h4 {
    margin-bottom: 15px;
    font-weight: 600;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

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

.logo {
    text-align: center;
    padding: 20px 0;
}

.logo h1 {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.logo p {
    color: var(--gray-color);
    font-size: 1rem;
}

/* Cards */
.card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 25px;
    margin-bottom: 20px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-color);
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.2);
}

.form-links {
    margin-top: 15px;
    text-align: center;
    font-size: 14px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    width: 100%;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
}

.btn-secondary {
    background-color: var(--light-gray);
    color: var(--dark-color);
}

.btn-secondary:hover {
    background-color: #d1d7dd;
}

.btn-action {
    background-color: var(--white);
    color: var(--dark-color);
    border: 1px solid var(--light-gray);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    width: 120px;
    height: 120px;
    margin: 10px;
}

.btn-action i {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.btn-action:hover {
    background-color: var(--light-gray);
    transform: translateY(-5px);
}

.btn-danger {
    color: var(--danger-color);
}

.btn-danger:hover {
    background-color: var(--danger-color);
    color: var(--white);
}

.btn-warning {
    color: var(--warning-color);
}

.btn-warning:hover {
    background-color: var(--warning-color);
    color: var(--white);
}

.btn-info {
    color: var(--info-color);
}

.btn-info:hover {
    background-color: var(--info-color);
    color: var(--white);
}

/* Account Info */
.account-info-container {
    background-color: var(--light-gray);
    border-radius: var(--border-radius);
    padding: 15px;
    margin: 15px 0;
}

.info-item {
    padding: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
}

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

.info-label {
    font-weight: 500;
    color: var(--gray-color);
}

.info-value {
    font-weight: 600;
    color: var(--dark-color);
}

/* Auth Forms */
.auth-form {
    max-width: 400px;
    margin: 0 auto;
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 25px;
    color: var(--primary-color);
}

/* Dashboard */
.user-info {
    text-align: center;
}

.balance-box {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-top: 20px;
}

.balance {
    font-size: 2.5rem;
    font-weight: 700;
    margin-top: 10px;
}

.logout-btn {
    margin-top: 15px;
    width: auto;
    padding: 8px 15px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.logout-btn i {
    margin-right: 5px;
}

.actions h3 {
    text-align: center;
    margin-bottom: 20px;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

/* History List */
.history-list {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    padding: 15px;
    border-bottom: 1px solid var(--light-gray);
}

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

.history-desc {
    font-weight: 500;
}

.history-time {
    font-size: 0.8rem;
    color: var(--gray-color);
}

/* QR Code */
.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--light-gray);
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.tab-btn.active {
    border-bottom: 3px solid var(--primary-color);
    color: var(--primary-color);
}

.tab-content {
    padding: 10px 0;
}

.qr-display {
    margin-top: 20px;
    text-align: center;
}

.gift-display {
    margin-top: 20px;
    text-align: center;
}

.gift-link-container {
    display: flex;
    margin: 15px 0;
}

.gift-link-container input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--light-gray);
    border-right: none;
    border-radius: var(--border-radius) 0 0 var(--border-radius);
}

.gift-link-container button {
    padding: 10px 15px;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.gift-qr-code {
    margin: 20px auto;
    max-width: 250px;
}

#qr-reader {
    width: 100%;
    margin: 20px 0;
}

.scan-instructions {
    background-color: var(--light-gray);
    border-left: 4px solid var(--info-color);
    padding: 10px 15px;
    margin: 10px 0 20px;
    border-radius: var(--border-radius);
    font-size: 14px;
}

.scan-instructions p {
    margin: 5px 0;
}

/* Gift Success Message */
.gift-success {
    text-align: center;
    padding: 20px 0;
}

.gift-icon {
    font-size: 3rem;
    color: #28a745;
    margin-bottom: 15px;
    animation: bounce 1s ease infinite;
}

.gift-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.gift-from {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--dark-color);
}

.gift-message {
    font-style: italic;
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: var(--border-radius);
    margin: 15px auto;
    max-width: 90%;
    color: #6c757d;
    border-left: 4px solid var(--primary-color);
}

.gift-congrats {
    margin-top: 15px;
    color: #28a745;
    font-weight: 500;
}

/* Transaction Success Animation */
.transaction-success {
    text-align: center;
    padding: 20px 0;
}

.success-checkmark {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    position: relative;
}

.success-checkmark .check-icon {
    width: 80px;
    height: 80px;
    position: relative;
    border-radius: 50%;
    box-sizing: content-box;
    border: 4px solid #4CAF50;
}

.success-checkmark .check-icon::before {
    top: 3px;
    left: -2px;
    width: 30px;
    transform-origin: 100% 50%;
    border-radius: 100px 0 0 100px;
}

.success-checkmark .check-icon::after {
    top: 0;
    left: 30px;
    width: 60px;
    transform-origin: 0 50%;
    border-radius: 0 100px 100px 0;
    animation: rotate-circle 4.25s ease-in;
}

.success-checkmark .check-icon::before, .success-checkmark .check-icon::after {
    content: '';
    height: 100px;
    position: absolute;
    background: #FFFFFF;
    transform: rotate(-45deg);
}

.success-checkmark .check-icon .icon-line {
    height: 5px;
    background-color: #4CAF50;
    display: block;
    border-radius: 2px;
    position: absolute;
    z-index: 10;
}

.success-checkmark .check-icon .icon-line.line-tip {
    top: 46px;
    left: 14px;
    width: 25px;
    transform: rotate(45deg);
    animation: icon-line-tip 0.75s;
}

.success-checkmark .check-icon .icon-line.line-long {
    top: 38px;
    right: 8px;
    width: 47px;
    transform: rotate(-45deg);
    animation: icon-line-long 0.75s;
}

.success-checkmark .check-icon .icon-circle {
    top: -4px;
    left: -4px;
    z-index: 10;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    position: absolute;
    box-sizing: content-box;
    border: 4px solid rgba(76, 175, 80, .5);
}

.success-checkmark .check-icon .icon-fix {
    top: 8px;
    width: 5px;
    left: 26px;
    z-index: 1;
    height: 85px;
    position: absolute;
    transform: rotate(-45deg);
    background-color: #FFFFFF;
}

@keyframes rotate-circle {
    0% {
        transform: rotate(-45deg);
    }
    5% {
        transform: rotate(-45deg);
    }
    12% {
        transform: rotate(-405deg);
    }
    100% {
        transform: rotate(-405deg);
    }
}

@keyframes icon-line-tip {
    0% {
        width: 0;
        left: 1px;
        top: 19px;
    }
    54% {
        width: 0;
        left: 1px;
        top: 19px;
    }
    70% {
        width: 50px;
        left: -8px;
        top: 37px;
    }
    84% {
        width: 17px;
        left: 21px;
        top: 48px;
    }
    100% {
        width: 25px;
        left: 14px;
        top: 46px;
    }
}

@keyframes icon-line-long {
    0% {
        width: 0;
        right: 46px;
        top: 54px;
    }
    65% {
        width: 0;
        right: 46px;
        top: 54px;
    }
    84% {
        width: 55px;
        right: 0px;
        top: 35px;
    }
    100% {
        width: 47px;
        right: 8px;
        top: 38px;
    }
}

.transaction-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 10px 0;
    animation: fade-up 0.5s ease-out 0.9s both;
}

.transaction-details {
    margin: 15px 0;
    animation: fade-up 0.5s ease-out 1.1s both;
}

.transaction-detail {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
}

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

.transaction-detail-label {
    font-weight: 500;
    color: #666;
}

.transaction-detail-value {
    font-weight: 600;
    color: var(--dark-color);
}

.transaction-message {
    margin-top: 20px;
    color: #28a745;
    font-weight: 500;
    animation: fade-up 0.5s ease-out 1.3s both;
}

@keyframes fade-up {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-15px);}
    60% {transform: translateY(-7px);}
}

/* Incoming Transfer Notification */
.incoming-transfer {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 350px;
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: hidden;
    transform: translateX(400px);
    transition: transform 0.3s ease-in-out;
}

.incoming-transfer.show {
    transform: translateX(0);
}

.incoming-transfer-content {
    display: flex;
    align-items: center;
    padding: 15px;
}

.incoming-transfer-icon {
    width: 50px;
    height: 50px;
    background-color: #4CAF50;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
}

.incoming-transfer-icon i {
    color: white;
    font-size: 24px;
}

.incoming-transfer-details {
    flex: 1;
}

.incoming-transfer-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 5px;
    color: var(--dark-color);
}

.incoming-transfer-message {
    font-size: 14px;
    color: #666;
}

.incoming-transfer-close {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 5px;
    margin-left: 10px;
}

.incoming-transfer-close:hover {
    color: var(--dark-color);
}

/* Balance Update Animation */
@keyframes balance-update {
    0% {
        color: var(--primary-color);
    }
    50% {
        color: #4CAF50;
    }
    100% {
        color: var(--primary-color);
    }
}

.balance-updated {
    animation: balance-update 1.5s ease;
}

/* Settings */
.settings-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 20px;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Notification System */
#notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.notification {
    background-color: var(--white);
    color: var(--dark-color);
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow);
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    animation: slideIn 0.3s ease-out forwards;
}

.notification.success {
    border-left-color: var(--success-color);
}

.notification.error {
    border-left-color: var(--danger-color);
}

.notification.warning {
    border-left-color: var(--warning-color);
}

.notification.info {
    border-left-color: var(--info-color);
}

.notification-icon {
    margin-right: 10px;
    font-size: 1.2rem;
}

.notification.success .notification-icon {
    color: var(--success-color);
}

.notification.error .notification-icon {
    color: var(--danger-color);
}

.notification.warning .notification-icon {
    color: var(--warning-color);
}

.notification.info .notification-icon {
    color: var(--info-color);
}

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

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

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--light-gray);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

#loading-text {
    color: var(--white);
    margin-top: 15px;
    font-size: 18px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

.modal-content {
    background-color: var(--white);
    padding: 25px;
    border-radius: var(--border-radius);
    max-width: 500px;
    width: 90%;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-color);
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
    gap: 10px;
}

.modal-buttons .btn {
    width: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-action {
        width: 100%;
        max-width: 250px;
        height: auto;
        flex-direction: row;
        justify-content: flex-start;
        padding: 15px;
    }
    
    .btn-action i {
        margin-right: 15px;
        margin-bottom: 0;
    }
}

/* Security Settings Styles */
.security-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.security-section:last-child {
    border-bottom: none;
}

.security-section h5 {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    color: #333;
}

.security-section h6 {
    font-size: 0.95rem;
    margin: 1rem 0 0.5rem;
    color: #555;
}

.success-text {
    color: #28a745;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.backup-codes-section {
    margin-top: 1rem;
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.5rem;
}

.backup-codes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.code {
    font-family: monospace;
    background-color: #e9ecef;
    padding: 0.5rem;
    border-radius: 0.25rem;
    text-align: center;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.button-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

#qr-code-container {
    margin: 1rem 0;
    display: flex;
    justify-content: center;
}

#secret-key {
    font-family: monospace;
    font-weight: bold;
    letter-spacing: 1px;
}

/* Trusted Devices */
.devices-list, .activity-list {
    margin-top: 1rem;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 0.5rem;
}

.empty-list {
    padding: 1rem;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

.device-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e0e0e0;
}

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

.device-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.device-details {
    font-size: 0.85rem;
    color: #6c757d;
    display: flex;
    flex-direction: column;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Login Activity */
.activity-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e0e0e0;
}

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

.activity-item.suspicious {
    background-color: #fff3cd;
}

.activity-icon {
    margin-right: 1rem;
    width: 2rem;
    height: 2rem;
    background-color: #e9ecef;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #495057;
}

.activity-details {
    flex: 1;
}

.activity-action {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.activity-time, .activity-device {
    font-size: 0.85rem;
    color: #6c757d;
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.85rem;
}

.password-strength.weak {
    background-color: #f8d7da;
    color: #721c24;
}

.password-strength.medium {
    background-color: #fff3cd;
    color: #856404;
}

.password-strength.strong {
    background-color: #d4edda;
    color: #155724;
}

.password-strength.very-strong {
    background-color: #cce5ff;
    color: #004085;
}

/* Session Timeout Select */
#session-timeout {
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}