* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: #f0f4f8;
    color: #334155;
    min-height: 100vh;
}

/* Header */
.top-header {
    background-color: var(--theme-color);
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 2;
}

/* Position modifiers for the logo ONLY */
.logo.pos-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.logo.pos-right {
    position: absolute;
    right: 30px;
}

.logo img {
    height: 50px;
    width: auto;
    object-fit: contain;
    transform-origin: left center;
    transition: all 0.2s ease;
    background-color: transparent;
}

.logo-fallback {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
}

.brand-info h1 {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
}

.brand-info .powered-by {
    font-size: 12px;
    opacity: 0.8;
}

.header-right {
    display: flex;
    align-items: center;
}

.datetime-pill {
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
    font-weight: 500;
}

.datetime-pill .divider {
    width: 1px;
    height: 15px;
    background: rgba(255, 255, 255, 0.3);
}

.datetime-pill .date,
.datetime-pill .time {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Main Dashboard */
.dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.status-pill {
    background-color: #e6f7ef;
    color: #059669;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.last-updated {
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.rate-card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.rate-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
}

.card-title {
    text-align: center;
    margin-bottom: 5px;
}

.card-title h2 {
    font-size: 32px;
    color: #1e293b;
    font-weight: 700;
}

.card-title h2 span {
    font-size: 16px;
    color: #94a3b8;
    font-weight: 500;
}

.card-title .purity {
    display: inline-block;
    color: var(--theme-color);
    font-size: 14px;
    font-weight: 600;
    margin-top: 5px;
}

/* Rate Rows */
.rate-row {
    border-radius: 12px;
    position: relative;
}

.purchase-rate {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #fdfdfd;
}

.purchase-rate::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background-color: var(--theme-color);
    border-radius: 0 4px 4px 0;
}

.purchase-rate .label {
    font-size: 13px;
    color: var(--theme-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.purchase-rate .value {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.base-rate {
    background: var(--theme-color);
    color: white;
    padding: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 8px 20px rgba(26, 99, 132, 0.15);
    /* Slightly colored shadow */
}

/* Decorative circles */
.base-rate .base-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: 1;
}

.base-rate .base-bg::before,
.base-rate .base-bg::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.base-rate .base-bg::before {
    width: 150px;
    height: 150px;
    right: -30px;
    top: -50px;
}

.base-rate .base-bg::after {
    width: 100px;
    height: 100px;
    right: 50px;
    bottom: -40px;
}

.base-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 5px;
    container-type: inline-size;
}

.base-content .label {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.base-content .label i {
    font-size: 18px;
    opacity: 0.8;
}

.base-content .value {
    font-size: clamp(20px, 11cqw, 38px);
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1;
    margin-top: 5px;
    white-space: nowrap;
}

.base-content .value .unit {
    font-size: 16px;
    font-weight: 500;
    opacity: 0.8;
}

.final-rate {
    background: #f8fafc;
    padding: 16px;
    display: flex;
    flex-direction: column;
    border: 1px solid #f1f5f9;
}

.final-rate .label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
}

.final-rate .label i {
    color: var(--theme-color);
}

.final-rate .value {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.final-rate .disclaimer {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.4;
}

/* Floating Status */
.floating-status {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: white;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 100;
}

.floating-status .dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .top-header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
        text-align: center;
    }

    .header-left {
        flex-direction: column;
        gap: 10px;
    }

    .logo.pos-center, .logo.pos-right {
        position: static;
        transform: none;
        margin: 0 auto !important;
    }

    .logo img {
        margin: 0 auto !important;
        transform-origin: center center;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
    }
}

@media (max-width: 600px) {
    .dashboard {
        padding: 15px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .rate-card {
        padding: 25px 15px;
        gap: 15px;
        border-radius: 14px;
    }

    .card-title h2 {
        font-size: 26px;
    }

    .card-title h2 span {
        font-size: 14px;
    }

    .card-title .purity {
        font-size: 13px;
        margin-top: 4px;
    }

    .purchase-rate {
        padding: 10px 12px;
    }

    .purchase-rate .label {
        font-size: 12px;
        gap: 6px;
    }

    .purchase-rate .value {
        font-size: 16px;
    }

    .base-rate {
        padding: 15px;
    }

    .base-content .label {
        font-size: 12px;
    }

    .base-content .label i {
        font-size: 16px;
    }

    .base-content .value {
        font-size: clamp(18px, 11cqw, 32px);
    }

    .base-content .value .unit {
        font-size: 14px;
    }

    .final-rate {
        padding: 12px;
    }

    .final-rate .label {
        font-size: 12px;
        margin-bottom: 5px;
    }

    .final-rate .value {
        font-size: 18px;
        margin-bottom: 6px;
    }

    .final-rate .disclaimer {
        font-size: 11px;
    }

    .floating-status {
        padding: 10px 20px;
        font-size: 13px;
        bottom: 15px;
        left: 15px;
    }

    .brand-info h1 {
        font-size: 20px;
    }

    .datetime-pill {
        padding: 8px 12px;
        font-size: 12px;
        gap: 10px;
    }
}

/* Share Functionality Styles */
.share-trigger {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--theme-color);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 100;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.share-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    filter: brightness(1.1);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-container {
    background: white;
    width: 90%;
    max-width: 450px;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active {
    display: flex;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 20px;
    color: #1e293b;
}

.close-modal {
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    font-size: 20px;
}

/* The Rate Card to Share */
#share-card-container {
    background: #fff;
    padding: 2px;
    border-radius: 12px;
}

.share-card {
    background: linear-gradient(135deg, var(--theme-color), #2c3e50);
    color: white;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.share-card .brand {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 5px;
}

.share-card .date {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 25px;
    display: block;
}

.share-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.share-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.share-item .label {
    font-size: 12px;
    display: block;
    margin-bottom: 5px;
    opacity: 0.9;
    font-weight: 500;
}

.share-item .value {
    font-size: 18px;
    font-weight: 700;
    display: block;
}

.share-card .footer-note {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 10px;
    display: block;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}

.btn-action {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-download {
    background: #f1f5f9;
    color: #1e293b;
}

.btn-share {
    background: #25d366; /* WhatsApp Green */
    color: white;
}

.btn-action:hover {
    filter: brightness(0.95);
    transform: translateY(-1px);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 600px) {
    .share-trigger {
        padding: 10px 20px;
        font-size: 12px;
        bottom: 15px;
        right: 15px;
    }
    
    .modal-container {
        padding: 20px;
    }
    
    .share-card {
        padding: 20px;
    }
    
    .share-item {
        padding: 10px;
    }
    
    .share-item .value {
        font-size: 16px;
    }
}