@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Noto+Sans+KR:wght@100..900&display=swap');

:root {
    /* Premium Color Palette */
    --primary-color: #0f172a;
    /* Deep Navy */
    --secondary-color: #d4af37;
    /* Gold/Bronze */
    --accent-color: #334155;
    /* Slate */
    --text-color: #1e293b;
    /* Dark Slate for text */
    --light-text: #f8fafc;
    /* Off-white for dark backgrounds */
    --background-color: #ffffff;
    --surface-color: #f1f5f9;
    /* Light Gray Surface */
    --border-color: #e2e8f0;

    /* Fonts */
    --font-kr: 'Noto Sans KR', sans-serif;
    --font-en: 'Inter', sans-serif;

    /* Spacing */
    --container-width: 1200px;
    --header-height: 80px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-en), var(--font-kr);
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.grid {
    display: grid;
}

.text-center {
    text-align: center;
}

.hidden {
    display: none;
}

/* Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

header .logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

header .logo span {
    color: var(--secondary-color);
}

header nav ul {
    display: flex;
    gap: 30px;
}

header nav a {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--accent-color);
}

header nav a:hover {
    color: var(--secondary-color);
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items:center;
}

.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e293b 100%);
    color: white;
    margin-top: var(--header-height);
    padding: 60px 0;
    text-align: center;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.page-header p {
    color: #cbd5e1;
    font-size: 1.1rem;
}

.content-section {
    padding: 80px 0;
}

.btn {
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-outline {
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--secondary-color);
}

.btn-primary:hover {
    background: #1e293b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

/* Hero Section */
.hero {
    height: 80vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://images.unsplash.com/photo-1578575437130-527eed3abbec?q=80&w=2070&auto=format&fit=crop') no-repeat center center/cover;
    opacity: 0.2;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 20px;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero h1 span {
    color: var(--secondary-color);
}

.hero p {
    font-size: 1.2rem;
    color: #cbd5e1;
    margin-bottom: 40px;
}

/* Services Section */
.services {
    padding: 80px 0;
    background: var(--surface-color);
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.section-title p {
    color: #64748b;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.service-card {
    background: white;
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--secondary-color);
}

.service-card h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.service-card p {
    color: #64748b;
    font-size: 0.9rem;
}

/* Recommended Products */
.products {
    padding: 80px 0;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}

.product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.product-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.product-image {
    height: 250px;
    background: #f1f5f9;
    position: relative;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-info {
    padding: 20px;
}

.product-category {
    font-size: 0.8rem;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
    display: block;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.product-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color);
}

/* Footer */
footer {
    background: var(--primary-color);
    color: white;
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    color: #94a3b8;
}

.footer-col ul li a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }

    .container {
        width: 100%;
        padding: 0 15px;
    }

    /* Header */
    header .container {
        flex-direction: column;
        justify-content: center;
        padding: 10px 15px;
        height: auto;
    }

    header .logo {
        margin-bottom: 10px;
    }

    header nav ul {
        gap: 15px;
        margin-bottom: 10px;
        font-size: 0.9rem;
    }

    .header-actions {
        display: none;
        /* Hide login/signup on mobile header to save space, or make them smaller */
    }

    /* Alternative Header Actions for Mobile */
    header nav ul li:last-child {
        margin-right: 0;
    }

    /* Hero */
    .hero {
        height: 60vh;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero-btns {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .hero-btns .btn {
        margin-left: 0 !important;
        width: 100%;
    }

    /* Services & Products */
    .services-grid,
    .product-grid {
        grid-template-columns: 1fr;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    /* Forms */
    .login-container,
    .signup-container,
    .find-container {
        padding: 20px;
        width: 90%;
    }

    /* Tables */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}


#loading {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(0,0,0,0.45);
    z-index: 9999;
    transition: opacity 200ms ease, visibility 200ms ease;
    opacity: 1;
    visibility: visible;
}
#loading.hidden {
  opacity: 0;
  visibility: hidden;
  display:none;
}

#loading .spinner {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  box-sizing: border-box;

  /* 외형: 두께 있는 테두리를 이용한 회전 스피너 */
  border: 6px solid rgba(255,255,255,0.18);  /* track */
  border-top-color: #ffffff;                 /* active part */
  border-left-color: rgba(255,255,255,0.65); /* 살짝 강조된 부분 */
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  transform: translateZ(0);
  animation: spin 900ms cubic-bezier(.4,.0,.2,1) infinite;
  animation-name: spin, popin;
  animation-duration: 900ms, 220ms;
  animation-iteration-count: infinite, 1;
  animation-timing-function: cubic-bezier(.4,.0,.2,1), cubic-bezier(.2,.9,.3,1);
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes popin {
  0%   { transform: scale(0.85) rotate(0deg); opacity: 0; }
  60%  { transform: scale(1.03) rotate(10deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.security-msg {
    position:fixed;
    top:0.5em;
    left:50%;
    width:auto;
    height:auto;
    white-space: nowrap;
    background:var(--primary-color);
    color: var(--secondary-color);
    padding:0.5em 1em;
    transform: translateX(-50%);
    border-radius:5px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}