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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #e8f1f8;
    color: #050505;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    max-width: 600px;
    margin: 0 auto;
    background: #e8f1f8;
    min-height: 100vh;
    position: relative;
    padding-bottom: 80px;
}

/* Header Section */
.header {
    background: white;
    padding: 16px 16px 12px;
}

.header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.icon-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #525457;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.icon-btn:hover {
    background-color: #f0f2f5;
}

.settings-btn {
    background: white;
    border: 1px solid #dfe1e5;
    width: 45px;
    height: 45px;
    padding: 0;
}

.settings-btn svg {
    width: 22px;
    height: 22px;
    stroke-width: 2.5;
}

.account-info {
    flex: 1;
    min-width: 0;
    padding-top: 4px;
}

.account-dropdown {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin-bottom: 4px;
}

.account-name {
    font-size: 24px;
    color: #1c1e21;
    margin: 0;
    font-weight: bold;
    line-height: 1.2;
}

.account-dropdown svg {
    color: #1c1e21;
    flex-shrink: 0;
}

.payment-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    margin-top: 4px;
}

.status-dot {
    width: 7px;
    height: 7px;
    background: #248b23;
    border-radius: 50%;
}

.status-text {
    color: #453e3e;
    font-weight: 400;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.notification-btn svg {
    width: 26px;
    height: 26px;
    stroke-width: 2;
}

.add-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #00796b;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.add-btn:hover {
    background: #00695c;
}

.add-btn svg {
    width: 28px;
    height: 28px;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
}

.filter-btn {
    background: white;
    border: 1px solid #dfe1e5;
    border-radius: 5px;
    padding: 7px 8px !important;
    cursor: pointer;
    font-size: 16px;
    color: #1c1e21;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    transition: background-color 0.2s;
    font-weight: 400;
}

.filter-btn:hover {
    background-color: #f0f2f5;
}

.hamburger-btn {
    padding: 14px;
    min-width: 56px;
    border-radius: 5px;
}

.hamburger-btn svg {
    width: 22px;
    height: 22px;
}

.dropdown-btn svg {
    width: 18px;
    height: 18px;
}

.dropdown-btn {
    border-radius: 5px;
}

/* Spending Overview */
.spending-overview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    padding: 16px;
    background: white;
    margin: 8px 16px;
    gap: 8px 20px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    position: relative;
}

.spending-left {
    grid-column: 1;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.spending-label {
    font-size: 12px;
    color: #65676b;
    font-weight: 400;
    line-height: 1.3;
}

.spending-amount {
    font-size: 24px;
    font-weight: 500;
    color: #1c1e21;
    line-height: 1.2;
}

.spending-right {
    grid-column: 2;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    padding-right: 32px;
}

.spending-limit-label {
    font-size: 12px;
    color: #65676b;
    font-weight: 400;
    line-height: 1.3;
}

.progress-bar-container {
    width: 100%;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e4e6eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: #0a7cff;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.arrow-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #65676b;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Campaigns Section */
.campaigns-section {
    padding: 20px 16px 16px;
    background: transparent;
    margin-top: 8px;
}

.campaigns-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.campaigns-title {
    font-size: 24px;
    font-weight: 700;
    color: #050505;
}

.campaigns-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-icon-btn,
.grid-icon-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #1c1e21;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn svg {
    width: 26px;
    height: 26px;
    stroke-width: 2;
}

.grid-btn svg {
    width: 26px;
    height: 26px;
}

/* Campaign Cards */
/* Campaign Cards - Refined Sizes */
.campaigns-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.campaign-card {
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    border: 1px solid #dddfe2;
}

.campaign-content {
    padding: 10px 12px;
}

.campaign-header {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.campaign-thumbnail {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    overflow: hidden;
    /* Changed from visible to hidden to clip image */
    flex-shrink: 0;
    background: #f0f2f5;
    position: relative;
}

.campaign-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    /* Let container handle radius or small radius */
}

/* Status badge removed from CSS as we removed it from HTML logic or kept it optional/hidden */

.campaign-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.campaign-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.campaign-title-text {
    flex: 1;
    font-size: 14px;
    color: #1c1e21;
    min-width: 0;
    line-height: 1.3;
}

.post-label {
    color: #65676b;
    font-weight: 400;
}

.post-title {
    color: #1c1e21;
    font-weight: 600;
    margin-bottom: 2px;
}

.campaign-status {
    font-size: 12px;
    color: #65676b;
}

.campaign-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    padding-bottom: 8px;
    padding-top: 0;
}

.metric-item {
    padding: 8px 12px 6px;
    border-right: 1px solid #e4e6eb;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.metric-item:first-child {
    padding-left: 12px;
}

.metric-item:last-child {
    border-right: none;
    padding-right: 12px;
}

.metric-value {
    font-size: 14px;
    font-weight: 700;
    color: #1c1e21;
    line-height: 1.2;
}

.metric-label {
    font-size: 11px;
    color: #65676b;
    line-height: 1.2;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 36px;
    /* Reduced from 44px */
    height: 20px;
    /* Reduced from 24px */
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccd0d5;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    /* Reduced from 20px */
    width: 16px;
    /* Reduced from 20px */
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked+.toggle-slider {
    background-color: #0a7cff;
}

input:checked+.toggle-slider:before {
    transform: translateX(16px);
    /* Adjusted for new width */
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    max-width: 100%;
    display: flex;
    justify-content: space-around;
    background: white;
    border-top: 1px solid #e4e6eb;
    padding: 8px 0;
    z-index: 100;
}

.nav-btn {
    background: none;
    border: none;
    color: #65676b;
    cursor: pointer;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.nav-btn svg {
    width: 30px;
    height: 30px;
}

.nav-btn.active {
    color: #050505;
}

.nav-btn.active svg {
    fill: #6b6969;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .app-container {
        max-width: 100%;
    }

    .spending-overview {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .spending-right {
        width: 100%;
    }

    .bottom-nav {
        width: 100%;
    }
}

@media (max-width: 400px) {
    .spending-amount {
        font-size: 20px;
    }

    .campaigns-title {
        font-size: 20px;
    }

    .campaign-metrics {
        gap: 12px;
    }
}

/* Standard Loader Styles */
.processing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.processing-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loader-dots {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    background-color: #e4e6eb;
    border-radius: 50%;
    animation: pulse 1.5s infinite ease-in-out;
}

/* ... existing animation keyframes (unchanged usually, but finding by block) ... */
/* Wait, I need to match the keyframes block to avoid deleting it if I replace a large chunk. 
   I will target just the specific CSS rules if possible, or include the keyframes in replacement if simpler.
   Let's replace the specific blocks.
*/

.dot:nth-child(1) {
    animation-delay: 0s;
}

.dot:nth-child(2) {
    animation-delay: 0.2s;
}

.dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
        background-color: #d0d2d6;
    }
}

.processing-text {
    font-size: 13px;
    color: #65676b;
    font-weight: 400;
}