/* ========== 기본 변수 ========== */
:root {
    --primary-color: #1D2659;
    --primary-hover: #2E3C8C;
    --secondary-color: #4E63D9;
    --accent-dark: #1D2659;
    --bg-light: #f8f9fd;
    --bg-white: #ffffff;
    --text-dark: #0f1635;
    --text-gray: #2E3C8C;
    --border-color: #4E63D9;
    --shadow-sm: 0 1px 3px rgba(29, 38, 89, 0.1);
    --shadow-md: 0 4px 12px rgba(29, 38, 89, 0.15);
    --shadow-lg: 0 8px 24px rgba(29, 38, 89, 0.2);
    --radius: 12px;
    --max-width: 1280px;
}

/* ========== 헤더 ========== */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
}

.logo-mark {
    background: var(--secondary-color);
    color: #ffffff;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 800;
    border: 2px solid var(--secondary-color);
    box-shadow: 0 2px 8px rgba(78, 99, 217, 0.3);
}

.logo-text {
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: 700;
    display: none;
}

.nav {
    display: flex;
    gap: 1rem;
    flex: 1;
    justify-content: center;
    margin-left: 3rem;
    flex-wrap: wrap;
    align-items: center;
}

.nav a {
    color: var(--text-gray);
    font-weight: 500;
    transition: color 0.2s;
    white-space: nowrap;
    font-size: 0.85rem;
}

.nav a:hover {
    color: var(--secondary-color);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-dark);
    border-radius: 2px;
}

/* 모바일 네비게이션 */
@media (max-width: 768px) {
    .nav {
        position: fixed;
        top: 60px;
        right: -100%;
        width: 250px;
        height: calc(100vh - 60px);
        background: var(--bg-white);
        flex-direction: column;
        padding: 2rem;
        box-shadow: var(--shadow-lg);
        transition: right 0.3s ease;
        z-index: 999;
    }
    
    .nav.active {
        right: 0;
    }
}

/* ========== 히어로 섹션 ========== */
.hero {
    background: var(--primary-color);
    color: #fff;
    padding: 5rem 2rem;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(78, 99, 217, 0.05);
    pointer-events: none;
}

.hero-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-text h1 {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.hero-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.hero-badges li {
    background: var(--secondary-color);
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(78, 99, 217, 0.3);
}

.hero-uploader {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.dropzone {
    border: 2px dashed var(--secondary-color);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s;
    background: rgba(78, 99, 217, 0.05);
}

.dropzone.drag-over {
    border-color: var(--primary-hover);
    background: rgba(78, 99, 217, 0.15);
    border-width: 3px;
}

.dropzone-inner {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.dropzone-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
}

.dropzone-sub {
    color: var(--text-gray);
    font-size: 0.95rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn.primary {
    background: var(--secondary-color);
    color: #fff;
    border: 2px solid var(--secondary-color);
}

.btn.primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(78, 99, 217, 0.3);
}

.dropzone-hint {
    font-size: 0.85rem;
    color: var(--text-gray);
}

.hero-note {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-gray);
    text-align: center;
}

/* ========== 색상 추출기 섹션 ========== */
.picker-section {
    padding: 5rem 2rem;
}

.section-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.section-inner h2 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 1rem;
}

.section-inner h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--secondary-color);
    border-radius: 2px;
}

.section-desc {
    text-align: center;
    color: var(--text-gray);
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

.picker-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.preview-card,
.color-card {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--radius);
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.preview-card h3,
.color-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.preview-box {
    position: relative;
    width: 100%;
    min-height: 400px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(78, 99, 217, 0.03);
}

#previewImg {
    max-width: 100%;
    max-height: 500px;
    cursor: crosshair;
    display: none;
}

#previewImg.loaded {
    display: block;
}

.preview-placeholder {
    color: var(--text-gray);
    text-align: center;
    padding: 2rem;
    line-height: 1.8;
}

.file-info {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(78, 99, 217, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-gray);
}

.file-info li {
    margin-bottom: 0.5rem;
}

.color-block {
    margin-bottom: 2rem;
}

.color-block h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary-hover);
}

.color-swatch {
    width: 100%;
    height: 80px;
    border-radius: 8px;
    border: 3px solid var(--border-color);
    margin-bottom: 1rem;
    transition: all 0.3s;
    box-shadow: var(--shadow-sm);
}

.color-codes {
    display: flex;
    gap: 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
}

.color-codes span {
    padding: 0.5rem 1rem;
    background: rgba(78, 99, 217, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    color: var(--primary-color);
    font-weight: 600;
}

.palette-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 1rem;
}

.palette-chip {
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
}

.palette-chip:hover {
    transform: translateY(-2px);
}

.palette-chip-color {
    width: 100%;
    height: 80px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.palette-chip-label {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    font-family: 'Courier New', monospace;
    color: var(--primary-color);
}

.small-note {
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-bottom: 1rem;
}

.status-message {
    margin-top: 2rem;
    padding: 1rem;
    background: rgba(78, 99, 217, 0.1);
    border-left: 4px solid var(--secondary-color);
    border-radius: 4px;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.hidden-canvas {
    display: none;
}

/* ========== 워터마크 툴 섹션 ========== */
.tool {
    padding: 5rem 2rem;
    background: rgba(78, 99, 217, 0.03);
}

.tool-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 2rem;
    margin-top: 3rem;
}

/* 패널 공통 */
.panel {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--radius);
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.panel-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.panel-subtitle {
    font-size: 0.9rem;
    color: var(--text-gray);
    margin-bottom: 1.5rem;
}

/* 업로드 그룹 */
.upload-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.upload-label {
    display: block;
    padding: 1rem;
    background: rgba(78, 99, 217, 0.05);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    color: var(--primary-color);
}

.upload-label:hover {
    background: rgba(78, 99, 217, 0.1);
    border-color: var(--primary-hover);
}

.upload-label input[type="file"] {
    display: none;
}

/* 토글 그룹 */
.toggle-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toggle-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(78, 99, 217, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.toggle-item:hover {
    background: rgba(78, 99, 217, 0.1);
}

.toggle-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.toggle-item span {
    font-weight: 600;
    color: var(--primary-color);
}

/* 옵션 그룹 */
.option-group {
    margin-top: 1.5rem;
}

.option-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-hover);
    margin-bottom: 1rem;
}

.option-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.option-row span:first-child {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.option-row input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(78, 99, 217, 0.2);
    outline: none;
}

.option-row input[type="range"]::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--secondary-color);
    cursor: pointer;
}

.option-row input[type="text"] {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
}

.option-row input[type="color"] {
    width: 100%;
    height: 50px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
}

.option-row select {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-white);
    cursor: pointer;
}

.value-display {
    font-weight: 700;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* 구분선 */
.divider {
    height: 1px;
    background: var(--border-color);
    margin: 1.5rem 0;
}

/* 다운로드 버튼 */
.btn-download {
    width: 100%;
    padding: 1rem;
    background: var(--secondary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-download:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-download:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* 캔버스 미리보기 */
.canvas-wrap {
    position: relative;
    width: 100%;
    min-height: 500px;
    background: rgba(78, 99, 217, 0.05);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#previewCanvas {
    max-width: 100%;
    max-height: 600px;
    display: none;
}

#previewCanvas.active {
    display: block;
}

.canvas-placeholder {
    text-align: center;
    color: var(--text-gray);
    padding: 2rem;
}

.canvas-placeholder p {
    font-size: 1.1rem;
}

/* ========== 사용 방법 섹션 ========== */
.howto {
    padding: 5rem 2rem;
    background: var(--bg-white);
}

.howto-list {
    max-width: 800px;
    margin: 2rem auto 0;
    padding-left: 2rem;
    list-style: decimal;
}

.howto-list li {
    font-size: 1.1rem;
    color: var(--text-dark);
    line-height: 1.8;
    margin-bottom: 1rem;
    padding-left: 0.5rem;
}

/* ========== FAQ 섹션 ========== */
.faq-section {
    padding: 5rem 2rem;
}

.faq-item {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
}

.faq-item:hover {
    border-color: var(--primary-hover);
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.faq-item h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.faq-item p {
    color: var(--text-gray);
    line-height: 1.7;
}

/* ========== 푸터 ========== */
.footer {
    background: var(--primary-color);
    color: #fff;
    padding: 2rem;
    text-align: center;
    border-top: 3px solid var(--secondary-color);
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.footer p {
    font-size: 0.9rem;
    opacity: 0.8;
}
