/* ==========================================================================
   Luxury Currency Rate Card Styling - Inspired by High-End Metallic Design
   ========================================================================== */

:root {
    /* Color Palette */
    --bg-dark: #070d17;
    --card-bg-start: #0f1c2d;
    --card-bg-end: #09131f;
    --item-bg-start: #0e1927;
    --item-bg-end: #08101a;
    
    /* Gold Metallic Gradients */
    --gold-primary: #d4af37;
    --gold-light: #fbe6a2;
    --gold-bright: #ffe685;
    --gold-dark: #8c6d26;
    --gold-gradient: linear-gradient(135deg, #fce49c 0%, #cfa344 40%, #7e5f20 70%, #e6ca7b 100%);
    --gold-gradient-soft: linear-gradient(180deg, #f7de94 0%, #b88f34 100%);
    --gold-border-gradient: linear-gradient(145deg, #f2d98d 0%, #9e792f 40%, #f7de94 70%, #614815 100%);
    
    /* Text Colors */
    --text-primary: #f0f4f8;
    --text-gold: #edd898;
    --text-muted: #8295ab;
    
    /* Shadows */
    --gold-glow: 0 0 25px rgba(212, 175, 55, 0.25);
    --card-shadow: 0 30px 60px rgba(0, 0, 0, 0.7), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    --item-shadow: 0 10px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 225, 150, 0.08);

    /* Radii */
    --card-radius: 40px;
    --item-radius: 24px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
    position: relative;
    overflow-x: hidden;
}

/* Background Glowing Elements & SVG Mesh */
.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: 
        radial-gradient(circle at 50% 30%, rgba(19, 35, 58, 0.6) 0%, transparent 70%),
        repeating-linear-gradient(45deg, rgba(212, 175, 55, 0.015) 0, rgba(212, 175, 55, 0.015) 1px, transparent 0, transparent 40px);
    z-index: -2;
}

.bg-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.18;
    z-index: -1;
    pointer-events: none;
}

.bg-glow-1 {
    top: -200px;
    left: -100px;
    background: radial-gradient(circle, #d4af37 0%, transparent 70%);
}

.bg-glow-2 {
    bottom: -200px;
    right: -100px;
    background: radial-gradient(circle, #1e3a5f 0%, transparent 70%);
}

/* App Main Container */
.app-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 440px;
}

/* Main Currency Card Widget */
.currency-card {
    position: relative;
    width: 100%;
    background: linear-gradient(175deg, var(--card-bg-start) 0%, var(--card-bg-end) 100%);
    border-radius: var(--card-radius);
    padding: 3.5rem 1.8rem 1.8rem 1.8rem;
    box-shadow: var(--card-shadow);
    border: 2px solid transparent;
    background-clip: padding-box;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Golden Border Overlay */
.currency-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--gold-border-gradient);
    border-radius: calc(var(--card-radius) + 2px);
    z-index: -1;
    opacity: 0.85;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.15);
}

.currency-card::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
    border: 1px solid rgba(255, 230, 150, 0.15);
    border-radius: calc(var(--card-radius) - 3px);
    pointer-events: none;
}

/* Header & Floating Logo */
.card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    margin-top: -5.8rem; /* Pull logo upwards so it hangs off top */
    margin-bottom: 0.5rem;
}

.logo-wrapper {
    position: relative;
    width: 112px;
    height: 112px;
    border-radius: 50%;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.logo-wrapper:hover {
    transform: scale(1.05);
}

.logo-wrapper:hover .logo-edit-hint {
    opacity: 1;
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    position: relative;
    z-index: 2;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
}

.logo-ring {
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 50%;
    background: var(--gold-gradient);
    z-index: 1;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6), 0 0 15px rgba(212, 175, 55, 0.4);
}

.logo-ring::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    background: #09121d;
    border-radius: 50%;
}

.logo-edit-hint {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: var(--gold-gradient);
    border: none;
    color: #070d17;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    z-index: 4;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    cursor: pointer;
}

.hidden-input {
    display: none;
}

.header-titles {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.main-title {
    font-size: 1.85rem;
    font-weight: 800;
    background: var(--gold-gradient-soft);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.subtitle-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-gold);
    font-size: 0.85rem;
    font-weight: 400;
    opacity: 0.9;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background-color: var(--gold-primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--gold-primary);
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.3); }
}

/* Currency Cards List */
.currency-list, .extra-currencies {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    width: 100%;
}

.extra-currencies {
    margin-top: -0.2rem;
}

.currency-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--item-bg-start) 0%, var(--item-bg-end) 100%);
    border-radius: var(--item-radius);
    padding: 1.1rem 1.3rem;
    box-shadow: var(--item-shadow);
    border: 1px solid rgba(212, 175, 55, 0.2);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    overflow: hidden;
}

.currency-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 230, 150, 0.4), transparent);
}

.currency-item:hover {
    transform: translateY(-2px);
    border-color: rgba(212, 175, 55, 0.5);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5), 0 0 15px rgba(212, 175, 55, 0.15);
}

/* Item Left Side: Currency Name & Code */
.currency-left {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 90px;
}

.currency-code {
    font-family: 'Cinzel', 'Vazirmatn', serif;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-gold);
    letter-spacing: 0.5px;
    line-height: 1.1;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.currency-name {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* Item Center: Price Value */
.currency-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    text-align: center;
}

.price-value-group {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
}

.price-number {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.price-unit {
    font-size: 0.85rem;
    color: var(--text-gold);
    font-weight: 500;
    opacity: 0.9;
}

.price-meta {
    font-size: 0.72rem;
}

.change-tag {
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.7rem;
    display: inline-block;
    direction: ltr;
}

.change-tag.positive {
    background: rgba(46, 213, 115, 0.12);
    color: #2ed573;
    border: 1px solid rgba(46, 213, 115, 0.3);
}

.change-tag.negative {
    background: rgba(255, 71, 87, 0.12);
    color: #ff4757;
    border: 1px solid rgba(255, 71, 87, 0.3);
}

.change-tag.neutral {
    background: rgba(212, 175, 55, 0.1);
    color: var(--text-gold);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

/* Item Right Side: Embossed Gold Coin */
.currency-right {
    display: flex;
    align-items: center;
    justify-content: center;
}

.coin-badge {
    position: relative;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--gold-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 6px 15px rgba(0, 0, 0, 0.6),
        inset 0 2px 3px rgba(255, 255, 255, 0.6),
        inset 0 -3px 5px rgba(0, 0, 0, 0.4);
    border: 2px solid #574112;
    transition: transform 0.3s ease;
}

.currency-item:hover .coin-badge {
    transform: rotate(10deg) scale(1.05);
}

.coin-badge::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border-radius: 50%;
    background: linear-gradient(145deg, #18283a 0%, #0d1622 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8), 0 1px 2px rgba(255, 230, 150, 0.3);
}

.coin-symbol {
    position: relative;
    z-index: 2;
    font-family: 'Cinzel', 'Vazirmatn', serif;
    font-size: 1.65rem;
    font-weight: 800;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.9));
}

/* Card Bottom Footer */
.card-footer {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-top: 0.4rem;
}

.footer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}

.date-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(10, 19, 31, 0.8);
    border: 1px solid rgba(212, 175, 55, 0.25);
    padding: 0.55rem 1.1rem;
    border-radius: 20px;
    font-size: 0.82rem;
    color: var(--text-gold);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.date-icon {
    font-size: 0.9rem;
    color: var(--gold-primary);
}

.control-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(15, 27, 43, 0.9);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--text-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.action-btn:hover {
    background: var(--gold-gradient);
    color: #070d17;
    border-color: var(--gold-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(212, 175, 55, 0.3);
}

.spinning {
    animation: spin 1s infinite linear;
}

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

/* Status Indicator */
.status-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.status-indicator {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #2ed573;
    box-shadow: 0 0 6px #2ed573;
}

.status-indicator.error {
    background-color: #ff4757;
    box-shadow: 0 0 6px #ff4757;
}

/* Watermark */
.watermark-footer {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1.5rem;
    font-size: 0.75rem;
    color: rgba(130, 149, 171, 0.5);
    letter-spacing: 0.2px;
}

.watermark-footer i {
    font-size: 0.7rem;
    color: rgba(212, 175, 55, 0.4);
}

/* Settings Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(4, 8, 15, 0.85);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden, .hidden {
    display: none !important;
}

.modal-content {
    background: linear-gradient(160deg, #101e30 0%, #0a1320 100%);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 28px;
    width: 100%;
    max-width: 420px;
    padding: 1.8rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(212, 175, 55, 0.15);
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.15rem;
    color: var(--text-gold);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gold-icon {
    color: var(--gold-primary);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

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

.modal-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.modal-desc code {
    background: rgba(212, 175, 55, 0.15);
    color: var(--text-gold);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.8rem;
    color: var(--text-gold);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="time"],
.form-group select {
    background: rgba(8, 15, 26, 0.8);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    padding: 0.7rem 0.9rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group input[type="time"]:focus,
.form-group select:focus {
    border-color: var(--gold-primary);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.schedule-times-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.4rem;
}

.times-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.6rem;
    max-height: 160px;
    overflow-y: auto;
    padding-right: 0.2rem;
}

.time-picker-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.time-picker-item span {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.time-picker-item input[type="time"] {
    padding: 0.45rem 0.6rem;
    text-align: center;
    font-size: 0.85rem;
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.4rem;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.7rem;
    margin-top: 0.5rem;
}

.btn {
    padding: 0.65rem 1.2rem;
    border-radius: 14px;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background: var(--gold-gradient);
    color: #070d17;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(212, 175, 55, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    .currency-card {
        padding: 3rem 1.2rem 1.5rem 1.2rem;
        border-radius: 32px;
    }

    .main-title {
        font-size: 1.6rem;
    }

    .logo-wrapper {
        width: 96px;
        height: 96px;
    }

    .price-number {
        font-size: 1.35rem;
    }

    .currency-code {
        font-size: 1.4rem;
    }

    .coin-badge {
        width: 50px;
        height: 50px;
    }

    .coin-symbol {
        font-size: 1.4rem;
    }
}
