/**
 * 마이랭킹 2026 - 메인 스타일
 * Google 미니멀 디자인 기반
 */

/* ===== CSS Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    line-height: 1.6;
    color: #202124;
    background-color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input {
    font-family: inherit;
    border: none;
    outline: none;
}

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===== Layout ===== */
#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    display: flex; flex-wrap: nowrap; flex-direction: column;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 16px;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 500;
    line-height: 1.3;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-muted { color: #5f6368; }
.text-primary { color: #1a73e8; }
.text-success { color: #34a853; }
.text-warning { color: #fbbc04; }
.text-danger { color: #ea4335; }

/* ===== Utilities ===== */
.hidden { display: none !important; }
.invisible { visibility: hidden; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 2rem; }

.flex { display: flex; }
.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.flex-column {
    display: flex;
    flex-direction: column;
}
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    transition: background-color 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background-color: #1a73e8;
    color: #fff;
}

.btn-primary:hover {
    background-color: #1557b0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.btn-secondary {
    background-color: #f8f9fa;
    color: #202124;
    border: 1px solid #dadce0;
}

.btn-secondary:hover {
    background-color: #f1f3f4;
    border-color: #d2d2d2;
}

.btn-text {
    color: #1a73e8;
    padding: 8px 12px;
}

.btn-text:hover {
    background-color: #e8f0fe;
}

.btn-sm {
    padding: 6px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 12px 32px;
    font-size: 16px;
}

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

.btn-outline:hover {
    background: #e8f0fe;
    border-color: #1557b0;
    color: #1557b0;
}

/* ===== Cards ===== */
.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
    overflow: hidden;
}

.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid #e0e0e0;
}

.card-body {
    padding: 16px 24px;
}

@media (max-width: 768px) {
    .card-body {
        padding: 16px 24px;
    }
}

@media (max-width: 480px) {
    .card-body {
        padding: 10px 10px;
    }
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
}

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 12px;
    background: #e8f0fe;
    color: #1a73e8;
}

.badge-gold {
    background: linear-gradient(135deg, #ffd700, #ffed4a);
    color: #7c5c00;
}

.badge-silver {
    background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
    color: #4a4a4a;
}

.badge-bronze {
    background: linear-gradient(135deg, #cd7f32, #e8a057);
    color: #5c3a11;
}

/* ===== Loading Spinner ===== */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #1a73e8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===== Button Ripple Effect ===== */
.btn {
    position: relative;
    overflow: hidden;
}

.btn-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    transform: scale(0);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ===== Revealed State (JS로 활성화) ===== */
.reveal-ready .card,
.reveal-ready .stat-card,
.reveal-ready .result-card,
.reveal-ready .best-records,
.reveal-ready .medal-summary {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal-ready .card.revealed,
.reveal-ready .stat-card.revealed,
.reveal-ready .result-card.revealed,
.reveal-ready .best-records.revealed,
.reveal-ready .medal-summary.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delay for cards */
.reveal-ready .stats-grid .stat-card:nth-child(1).revealed { transition-delay: 0.1s; }
.reveal-ready .stats-grid .stat-card:nth-child(2).revealed { transition-delay: 0.2s; }
.reveal-ready .stats-grid .stat-card:nth-child(3).revealed { transition-delay: 0.3s; }
.reveal-ready .stats-grid .stat-card:nth-child(4).revealed { transition-delay: 0.4s; }

/* ===== Gradient Border Effect ===== */
.gradient-border {
    position: relative;
    background: #fff;
    border-radius: 8px;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #1a73e8, #4285f4, #34a853, #fbbc04);
    background-size: 300% 300%;
    border-radius: 10px;
    z-index: -1;
    animation: gradientBorder 4s ease infinite;
}

@keyframes gradientBorder {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ===== Glow Effect ===== */
.glow-effect {
    box-shadow: 0 0 20px rgba(26, 115, 232, 0.3);
    transition: box-shadow 0.3s ease;
}

.glow-effect:hover {
    box-shadow: 0 0 30px rgba(26, 115, 232, 0.5);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* ===== Material Icons ===== */
.material-symbols-outlined {
    font-variation-settings:
        'FILL' 0,
        'wght' 400,
        'GRAD' 0,
        'opsz' 24;
    vertical-align: middle;
}

/* ===== Header ===== */
.site-header {
    padding: 16px 0;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 24px;
    font-weight: 700;
    color: #1a73e8;
}

.logo img {
    height: 32px;
}

/* ===== Footer ===== */
.site-footer {
    margin-top: auto;
    padding: 24px 0;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    color: #5f6368;
    font-size: 14px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    text-align: center;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    .container {
        padding: 0 12px;
    }

    .btn {
        padding: 8px 16px;
    }
}

@media (max-width: 480px) {
    .header-inner {
        flex-direction: column;
        gap: 12px;
    }
}

/* ===== Footer ===== */
.site-footer {
    background: #f8f9fa;
    border-top: 1px solid #e8eaed;
    padding: 32px 16px;
    margin-top: 48px;
}

.footer-inner {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-bottom: 20px;
}

.footer-links a {
    font-size: 13px;
    color: #5f6368;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #1a73e8;
}

.footer-contact {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #5f6368;
}

.footer-contact a {
    color: #1a73e8;
}

.footer-contact a:hover {
    text-decoration: underline;
}

.footer-instagram {
    display: inline-flex;
    align-items: center;
}

.footer-instagram img {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.footer-copyright {
    font-size: 12px;
    color: #9aa0a6;
}

.footer-copyright p {
    margin: 0;
}

@media (max-width: 768px) {
    .site-footer {
        padding: 24px 16px;
        margin-top: 32px;
    }

    .footer-links {
        gap: 6px 16px;
    }

    .footer-links a {
        font-size: 12px;
    }

    .footer-contact {
        font-size: 12px;
        gap: 8px;
    }
}
