/* photoagain Advertiser Center - Mobile First CSS */
:root {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-muted: #64748b;
    --brand-color: #2563eb;
    --brand-hover: #1d4ed8;
    --accent-color: #10b981;
    --danger-color: #ef4444;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
}

.app-container {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-main);
    box-shadow: 0 0 20px rgba(0,0,0,0.03);
}

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

.logo-area {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-badge {
    background-color: var(--brand-color);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 4px;
}

.brand-title {
    font-size: 18px;
    font-weight: 700;
}

.brand-title span {
    font-weight: 500;
    font-size: 15px;
    color: var(--text-muted);
}

.user-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-color);
}

/* Balance Card */
.balance-card {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: white;
    margin: 16px;
    padding: 20px;
    border-radius: var(--radius-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
}

.balance-label {
    font-size: 12px;
    color: #94a3b8;
    display: block;
}

.balance-amount {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-top: 4px;
}

/* Buttons & Touch */
.btn {
    border: none;
    border-radius: var(--radius-md);
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.btn-touch {
    min-height: 44px; /* Apple Human Interface Guideline minimum touch target */
}

.btn-touch:active {
    transform: scale(0.98);
}

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

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

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

.btn-block {
    width: 100%;
}

/* Nav Tabs */
.nav-tabs {
    display: flex;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    flex: 1;
    min-width: 100px;
    padding: 14px 12px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
}

.tab-btn.active {
    color: var(--brand-color);
    border-bottom-color: var(--brand-color);
}

/* Main Content & Tab Content */
.main-content {
    flex: 1;
    padding-bottom: 40px;
}

.tab-content {
    display: none;
    padding: 16px;
}

.tab-content.active {
    display: block;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}

.section-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-box {
    background-color: var(--bg-card);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.stat-icon {
    font-size: 20px;
    margin-bottom: 8px;
}

.stat-num {
    font-size: 22px;
    font-weight: 700;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
}

.fraud-box {
    border-color: #fde68a;
    background-color: #fffbeb;
}

/* Breakdown List */
.card-section {
    background-color: var(--bg-card);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.card-section h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px dashed var(--border-color);
}

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

/* Forms */
.mobile-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-control {
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background-color: var(--bg-card);
    outline: none;
}

.form-control:focus {
    border-color: var(--brand-color);
}

/* Preview Simulator Box */
.preview-box {
    background-color: #f1f5f9;
    padding: 16px;
    border-radius: var(--radius-md);
    margin-top: 8px;
}

.preview-tag {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    display: block;
    margin-bottom: 10px;
}

/* Standardized Ad Card Template */
.ad-template-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.ad-card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: rgba(0,0,0,0.6);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}

.ad-card-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.ad-card-body {
    padding: 12px 14px;
}

.ad-card-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ad-card-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ad-card-company {
    font-size: 11px;
    font-weight: 600;
    color: var(--brand-color);
}

/* Creatives Grid */
.creatives-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.empty-state {
    text-align: center;
    padding: 30px 16px;
    color: var(--text-muted);
    font-size: 14px;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 16px;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    background-color: var(--bg-card);
    width: 100%;
    max-width: 440px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-sub {
    font-size: 13px;
    color: var(--text-muted);
}

.amount-options {
    display: flex;
    gap: 8px;
}

.amount-btn {
    flex: 1;
    padding: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-main);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

/* PC Responsive Layout (Fluid Expansion for Screen Width >= 1024px) */
@media (min-width: 1024px) {
    .app-container {
        max-width: 1100px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .creatives-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }
}
