/* 기본 리셋 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
    background-color: #f5f7fa;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}


/* 페이지 로드 애니메이션 */
.dashboard > * {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
}

.dashboard .hero {
    animation-delay: 0.1s;
}

.dashboard .quick-grid {
    animation-delay: 0.3s;
}

.dashboard .lower-grid {
    animation-delay: 0.5s;
}

.dashboard .lower-grid .panel {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease forwards;
}

.dashboard .lower-grid .panel:nth-child(1) {
    animation-delay: 0.7s;
}

.dashboard .lower-grid .panel:nth-child(2) {
    animation-delay: 0.8s;
}

.dashboard .lower-grid .panel:nth-child(3) {
    animation-delay: 0.9s;
}

.dashboard .ranking-section {
    animation-delay: 1.1s;
}

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

/* 히어로 섹션 */
.hero {
    background: #ffffff;
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 16px;
    text-align: center;
    position: relative;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.hero-content {
    width: 100%;
}

.hero-badge {
    display: inline-block;
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.hero-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 16px;
    line-height: 1.3;
}

.hero-desc {
    font-size: 1rem;
    color: #6b7280;
    margin-bottom: 16px;
    line-height: 1.6;
}

.hero-help {
    color: #3b82f6;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.hero-help:hover {
    text-decoration: underline;
}

/* 히어로 섹션 내 광고주 목록 */
.hero-advertisers-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1f2937;
    text-align: left;
    position: relative;
    padding-left: 16px;
}

.hero-advertisers-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-radius: 2px;
}

.advertisers-scroll-container {
    position: relative;
    width: calc(100% - 64px); /* 양옆에 32px씩 패딩 */
    height: 280px;
    margin: 16px 32px 0 32px; /* 양옆에 32px씩 마진 */
}

.advertisers-scroll-track {
    display: flex;
    gap: 16px;
    height: 100%;
    width: max-content;
    animation: scroll 80s linear infinite;
    will-change: transform;
}

.advertisers-scroll-track.scrolling {
    animation-play-state: running;
}

.advertisers-scroll-track:hover {
    animation-play-state: paused;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.hero-advertiser-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    transition: all 0.2s ease;
    min-width: 400px;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.hero-advertiser-card::before {
    content: var(--logo-char);
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    width: 120px;
    height: 120px;
    font-size: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: var(--logo-color, #cbd5e1);
    opacity: 0.06;
    pointer-events: none;
    z-index: 0;
    line-height: 1;
    letter-spacing: -0.05em;
}

.hero-advertiser-card:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.hero-advertiser-card:hover::before {
    opacity: 0.1;
    transform: translateY(-50%) scale(1.1);
}

.hero-advertiser-header,
.hero-advertiser-details {
    position: relative;
}

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

.hero-advertiser-info {
    flex: 1;
}

.hero-advertiser-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.hero-advertiser-platform {
    font-size: 0.875rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 400;
}

.hero-status-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-advertiser-details {
    margin-bottom: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.hero-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.875rem;
}

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

.hero-detail-label {
    color: #6b7280;
    font-weight: 500;
}

.hero-detail-value {
    color: #374151;
    font-weight: 600;
}

.hero-detail-value.commission {
    color: #16a34a;
    font-weight: 700;
}

/* 광고주 섹션 */
.advertisers-section {
    margin-bottom: 32px;
}

.section-header {
    text-align: center;
    margin-bottom: 24px;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
}

.section-subtitle {
    color: #6b7280;
    font-size: 1rem;
    margin: 0;
}

.advertisers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.advertiser-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.advertiser-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    border-color: #3b82f6;
}

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

.advertiser-info {
    flex: 1;
}

.advertiser-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
}

.advertiser-platform {
    font-size: 0.875rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-active {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.status-pending {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-review {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.status-inactive {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
    border: 1px solid rgba(107, 114, 128, 0.2);
}

.advertiser-details {
    margin-bottom: 16px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

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

.detail-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.detail-value {
    font-size: 0.875rem;
    color: #374151;
    font-weight: 600;
}

.detail-value.commission {
    color: #16a34a;
    font-weight: 700;
}

.advertiser-actions {
    display: flex;
    justify-content: flex-end;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
}

.btn-outline {
    background: transparent;
    color: #3b82f6;
    border: 1px solid #3b82f6;
}

.btn-outline:hover {
    background: #3b82f6;
    color: white;
}

.section-footer {
    text-align: center;
}

.loading-card {
    background: #fef3ff;
    border-radius: 12px;
    padding: 40px 20px;
    color: #6b7280;
    min-width: 360px;
    height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading-card-1 {
    background: #fef3ff;
}

.loading-card-2 {
    background: #fff7ed;
}

.loading-card-3 {
    background: #f0fdf4;
}

.loading-card-4 {
    background: #fce7f3;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.empty-state i {
    font-size: 2rem;
    margin-bottom: 12px;
    color: #9ca3af;
}

/* 퀵 그리드 */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.quick-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    text-decoration: none;
    color: #374151;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.quick-card:hover {
    transform: translateY(-2px);
    border-color: #3b82f6;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
}

.q-title {
    font-weight: 700;
    font-size: 18px;
    color: #1f2937;
}

.q-desc {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
}

.q-more {
    margin-top: auto;
    color: #3b82f6;
    font-size: 13px;
    font-weight: 500;
}

/* 하단 그리드 */
.lower-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 16px;
}

.panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.panel-head {
    padding: 16px 18px;
    border-bottom: 1px solid #e5e7eb;
}

.panel-head h3 {
    margin: 0;
    color: #1f2937;
    font-size: 16px;
    font-weight: 600;
}

.panel-foot {
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
}

.link-more {
    color: #3b82f6;
    font-size: 13px;
    text-decoration: none;
    font-weight: 500;
}

.link-more:hover {
    text-decoration: underline;
}

/* 공지 테이블 */
.table-wrap {
    overflow-x: auto;
}

.notice-table {
    width: 100%;
    border-collapse: collapse;
}

.notice-table th,
.notice-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.notice-table thead th {
    color: #6b7280;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.n-link {
    color: #374151;
    text-decoration: none;
    font-size: 14px;
}

.n-link:hover {
    text-decoration: underline;
    color: #3b82f6;
}

.col-date {
    width: 120px;
    color: #6b7280;
    font-size: 13px;
}

.empty {
    color: #9ca3af;
    text-align: center;
    padding: 20px 0;
    font-size: 14px;
}

.badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    vertical-align: middle;
}

.badge-important {
    background: rgba(239,68,68,0.15);
    color: #f87171;
    border: 1px solid rgba(239,68,68,0.35);
}

.badge-new {
    background: rgba(34,197,94,0.15);
    color: #86efac;
    border: 1px solid rgba(34,197,94,0.35);
}

/* 서포트 섹션 */
.support-actions {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-1px);
}

.btn-accent {
    background: #22c55e;
    color: #062e12;
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    display: inline-block;
    font-size: 13px;
}

.btn-accent:hover {
    background: #16a34a;
    transform: translateY(-1px);
}

/* 이벤트 섹션 */
.event-box {
    padding: 18px;
}

.event-title {
    color: #1f2937;
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 14px;
}

.event-list {
    margin: 0 0 12px 16px;
    color: #6b7280;
    font-size: 13px;
}

.event-list li {
    margin-bottom: 4px;
}

/* 상품 페이지 조회수 순위 섹션 */
.ranking-section {
    margin-top: 24px;
}

.ranking-panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.ranking-panel .panel-head h3 {
    margin: 0;
    color: #1f2937;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ranking-content {
    padding: 18px;
    flex: 1;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    position: relative;
}

.ranking-item:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.rank-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #6b7280;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    margin-right: 16px;
    flex-shrink: 0;
}

.rank-1 .rank-number {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #1f2937;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.rank-2 .rank-number {
    background: linear-gradient(135deg, #c0c0c0, #e5e7eb);
    color: #1f2937;
    box-shadow: 0 2px 8px rgba(192, 192, 192, 0.3);
}

.rank-3 .rank-number {
    background: linear-gradient(135deg, #cd7f32, #d97706);
    color: white;
    box-shadow: 0 2px 8px rgba(205, 127, 50, 0.3);
}

.product-info {
    flex: 1;
    margin-right: 16px;
}

.product-name {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
    line-height: 1.3;
}

.product-category {
    font-size: 12px;
    color: #6b7280;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
}

.view-count {
    text-align: right;
    flex-shrink: 0;
}

.view-count .count {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}

.view-count .unit {
    font-size: 12px;
    color: #6b7280;
    margin-left: 2px;
}

/* 반응형 */
@media (max-width: 768px) {
    .dashboard {
        padding: 16px;
    }
    
    .hero {
        padding: 16px;
        margin-bottom: 12px;
        min-height: 160px;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .advertisers-scroll-container {
        height: 260px;
        width: calc(100% - 48px); /* 양옆에 24px씩 패딩 */
        margin: 16px 24px 0 24px; /* 양옆에 24px씩 마진 */
    }
    
    .hero-advertiser-card {
        min-width: 240px;
        height: 140px;
        padding: 16px;
    }
    
    .advertisers-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .advertiser-card {
        padding: 16px;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .quick-grid {
        grid-template-columns: 1fr;
    }
    
    .lower-grid {
        grid-template-columns: 1fr;
    }
    
    .support-actions {
        flex-direction: column;
    }
    
    .ranking-item {
        padding: 12px;
    }
    
    .product-name {
        font-size: 14px;
    }
    
    .view-count .count {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 20px;
    }
    
    .hero-title {
        font-size: 1.25rem;
    }
    
    .quick-card {
        padding: 20px;
    }
}