/* PayMyBill - Global Styles */
:root {
    --primary-color: #009688;
    --primary-dark: #00796B;
    --secondary-color: #003049;
    --background: #F6F6F6;
    --white: #FFFFFF;
    --text-primary: #212121;
    --text-secondary: #757575;
    --border-color: #E0E0E0;
    --success: #4CAF50;
    --warning: #FF9800;
    --error: #F44336;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-strong: rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    background: var(--white);
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 20px var(--shadow);
}

/* Screen Management */
.screen {
    display: none;
    flex-direction: column;
    min-height: 100vh;
    animation: fadeIn 0.3s ease-in;
}

.screen.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.screen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.screen-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.dashboard-header {
    border-bottom: none;
    padding: 20px;
}

.header-spacer {
    width: 40px;
}

.screen-content {
    flex: 1;
    padding: 20px;
    padding-bottom: 80px;
    overflow-y: auto;
}

/* Loading Screen */
#loading-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Welcome Screen */
.logo-container {
    text-align: center;
    margin: 60px 0 40px;
}

.app-logo {
    width: 80px;
    height: 80px;
    background: var(--primary-color);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 4px 12px var(--shadow);
}

.app-logo .material-icons {
    font-size: 48px;
    color: var(--white);
}

.app-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 8px;
}

.app-tagline {
    font-size: 16px;
    color: var(--text-secondary);
}

.language-selector {
    margin: 40px 0;
}

.language-selector label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.custom-select {
    position: relative;
}

.custom-select select {
    width: 100%;
    padding: 14px 40px 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    color: var(--text-primary);
    background: var(--white);
    appearance: none;
    cursor: pointer;
    transition: all 0.3s;
}

.custom-select select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.custom-select .material-icons {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-secondary);
}

/* Buttons */
.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: var(--border-color);
    color: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

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

.btn-large {
    width: 100%;
    padding: 16px;
    font-size: 18px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.btn-icon:hover {
    background: var(--background);
}

.btn-icon-sm {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.btn-icon-sm .material-icons {
    font-size: 20px;
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px;
}

.btn-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: var(--white);
}

/* Feature List */
.feature-list {
    margin-top: 40px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    color: var(--text-secondary);
}

.feature-item .material-icons {
    color: var(--primary-color);
    font-size: 24px;
}

/* Progress Bar */
.progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 100px;
}

.progress-step span {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
}

.progress-step.active span {
    color: var(--primary-color);
    font-weight: 600;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: all 0.3s;
}

.progress-step.active .step-circle {
    background: var(--primary-color);
    color: var(--white);
}

.progress-line {
    height: 2px;
    flex: 1;
    background: var(--border-color);
    margin: 0 -10px;
}

/* Info Box */
.info-box {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: #E3F2FD;
    border-radius: 12px;
    margin-bottom: 20px;
    color: #1976D2;
}

.info-box.success {
    background: #E8F5E9;
    color: var(--success);
}

.info-box .material-icons {
    flex-shrink: 0;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 20px;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(0, 150, 136, 0.05);
}

.upload-area .material-icons {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.upload-area p {
    color: var(--text-secondary);
}

.preview-container {
    position: relative;
    margin-bottom: 20px;
}

.preview-container img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow);
}

/* User Greeting */
.user-greeting h2 {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
}

.user-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Balance Card */
.balance-card {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px var(--shadow);
}

.balance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.balance-amount {
    font-size: 36px;
    font-weight: 700;
    color: var(--white);
}

.balance-hidden {
    font-size: 36px;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 4px;
}

/* Virtual Card Preview */
.virtual-card-preview {
    margin-bottom: 24px;
}

.card-front {
    background: linear-gradient(135deg, var(--secondary-color), #004d6b);
    border-radius: 16px;
    padding: 24px;
    aspect-ratio: 1.586;
    position: relative;
    box-shadow: 0 8px 24px var(--shadow-strong);
}

.card-chip {
    width: 48px;
    height: 36px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border-radius: 6px;
    margin-bottom: 24px;
}

.card-number {
    font-size: 22px;
    color: var(--white);
    letter-spacing: 2px;
    margin-bottom: 20px;
    font-weight: 500;
}

.card-details {
    display: flex;
    gap: 40px;
}

.card-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.card-value {
    font-size: 14px;
    color: var(--white);
    font-weight: 500;
}

/* Full Card */
.card-full {
    background: linear-gradient(135deg, var(--secondary-color), #004d6b);
    border-radius: 20px;
    padding: 32px 24px;
    aspect-ratio: 1.586;
    position: relative;
    box-shadow: 0 12px 32px var(--shadow-strong);
    margin-bottom: 24px;
}

.card-number-full {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 24px;
    color: var(--white);
    letter-spacing: 2px;
    margin-bottom: 24px;
    font-weight: 500;
}

.card-details-full {
    display: flex;
    gap: 24px;
}

/* Card Actions */
.card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 32px;
}

.card-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
}

.card-action-btn:hover {
    border-color: var(--primary-color);
    background: rgba(0, 150, 136, 0.05);
}

.card-action-btn .material-icons {
    font-size: 32px;
    color: var(--text-primary);
}

/* Card Controls */
.card-controls {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.control-item,
.control-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--white);
    border: none;
    cursor: pointer;
    transition: background 0.3s;
    width: 100%;
    text-align: left;
}

.control-btn:hover {
    background: var(--background);
}

.control-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.control-info .material-icons {
    color: var(--text-secondary);
    font-size: 24px;
}

.control-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.control-description {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--border-color);
    transition: 0.4s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background: var(--white);
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background: var(--primary-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 12px;
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 13px;
    text-align: center;
}

.action-btn:hover {
    border-color: var(--primary-color);
    background: rgba(0, 150, 136, 0.05);
    transform: translateY(-2px);
}

.action-btn .material-icons {
    font-size: 32px;
    color: var(--primary-color);
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h3 {
    font-size: 18px;
    font-weight: 600;
}

/* Transaction List */
.transaction-list,
.transaction-list-full {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.transaction-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.transaction-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px var(--shadow);
}

.transaction-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.transaction-icon.check {
    background: #E8F5E9;
    color: var(--success);
}

.transaction-icon.bill {
    background: #FFF3E0;
    color: var(--warning);
}

.transaction-icon.topup {
    background: #E3F2FD;
    color: #1976D2;
}

.transaction-info {
    flex: 1;
}

.transaction-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
}

.transaction-date {
    font-size: 14px;
    color: var(--text-secondary);
}

.transaction-amount {
    font-size: 16px;
    font-weight: 600;
    text-align: right;
}

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

.transaction-amount.negative {
    color: var(--text-primary);
}

.transaction-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 4px;
}

.transaction-status.completed {
    background: #E8F5E9;
    color: var(--success);
}

.transaction-status.pending {
    background: #FFF3E0;
    color: var(--warning);
}

.transaction-status.failed {
    background: #FFEBEE;
    color: var(--error);
}

/* Filter Chips */
.filter-chips {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.chip {
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    background: var(--white);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.chip:hover {
    border-color: var(--primary-color);
}

.chip.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* Check Details */
.check-details-card {
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.detail-row.total {
    padding-top: 16px;
    margin-top: 8px;
    border-top: 2px solid var(--border-color);
}

.amount-highlight {
    color: var(--primary-color);
    font-size: 20px;
}

/* Processing Animation */
.processing-animation {
    text-align: center;
    margin: 40px 0;
}

.processing-spinner {
    width: 80px;
    height: 80px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
}

.processing-animation h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.processing-animation p {
    color: var(--text-secondary);
}

.processing-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 32px;
}

.processing-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--background);
    border-radius: 12px;
}

.processing-step .material-icons {
    font-size: 24px;
    color: var(--text-secondary);
}

.processing-step.completed .material-icons {
    color: var(--success);
}

.processing-step.active {
    background: rgba(0, 150, 136, 0.1);
}

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

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

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

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.input-with-prefix {
    position: relative;
}

.input-prefix {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-with-prefix .form-input {
    padding-left: 36px;
}

/* Profile */
.profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: var(--background);
    border-radius: 16px;
    margin-bottom: 32px;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar .material-icons {
    font-size: 40px;
    color: var(--white);
}

.profile-info h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.profile-info p {
    color: var(--text-secondary);
}

.settings-section {
    margin-bottom: 32px;
}

.settings-section h4 {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    text-align: left;
}

.settings-item:hover {
    border-color: var(--primary-color);
    background: rgba(0, 150, 136, 0.05);
}

.settings-item-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.settings-item-content .material-icons {
    color: var(--text-secondary);
}

.settings-item-value {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    display: flex;
    background: var(--white);
    border-top: 1px solid var(--border-color);
    padding: 8px 0;
    z-index: 100;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 12px;
}

.nav-item:hover {
    color: var(--primary-color);
}

.nav-item.active {
    color: var(--primary-color);
    font-weight: 600;
}

.nav-item .material-icons {
    font-size: 24px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 20px;
    padding: 32px;
    max-width: 90%;
    text-align: center;
    animation: slideUp 0.3s ease-out;
}

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

.modal-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.modal-icon.success {
    background: #E8F5E9;
}

.modal-icon .material-icons {
    font-size: 48px;
    color: var(--success);
}

.modal-content h3 {
    font-size: 24px;
    margin-bottom: 12px;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Responsive Design */
@media (max-width: 380px) {
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .action-btn {
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
    }
    
    .card-actions {
        grid-template-columns: 1fr;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --text-secondary: #000000;
    }
}
