:root {
    --primary: #007AFF;
    --primary-hover: #005bb5;
    --text-main: #1c1c1e;
    --text-muted: #8e8e93;
    --bg-body: #f2f2f7;
    --bg-container: rgba(255, 255, 255, 0.85);
    --border-color: rgba(255, 255, 255, 0.4);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    margin: 0;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.app-wrapper {
    flex: 1;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}
/* Bubble Background */
.bubble-bg {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}
.bubble {
    position: absolute;
    border-radius: 50%;
    background: rgba(0, 122, 255, 0.08);
    animation: float 15s infinite ease-in-out alternate;
    filter: blur(40px);
}
.bubble-1 { width: 400px; height: 400px; top: -100px; left: -100px; }
.bubble-2 { width: 500px; height: 500px; bottom: -150px; right: -100px; animation-delay: -2s; background: rgba(52, 199, 89, 0.08); }
.bubble-3 { width: 300px; height: 300px; bottom: 20%; left: 20%; animation-delay: -5s; background: rgba(255, 59, 48, 0.05); }

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, -50px) scale(1.1); }
}
.container {
    background: var(--bg-container);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    width: 98%;
    max-width: 1200px;
    box-sizing: border-box;
    z-index: 1;
}
h1 {
    margin-top: 0;
    color: var(--text-main);
    text-align: center;
    font-weight: 700;
}
.subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 25px;
    font-size: 15px;
}
.upload-area {
    border: 2px dashed #c7c7cc;
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: rgba(255,255,255,0.5);
    margin-bottom: 30px;
}
.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary);
    background-color: rgba(0, 122, 255, 0.05);
}
.upload-area p {
    margin: 10px 0 0;
    font-size: 16px;
    color: var(--text-main);
}
.upload-icon {
    font-size: 40px;
    color: var(--primary);
    margin-bottom: 10px;
}
#fileInput {
    display: none;
}

.content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: center;
}
@media (min-width: 768px) {
    .content-wrapper {
        flex-direction: row;
        align-items: flex-start;
    }
}

.image-preview-container {
    flex: 1;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255,255,255,0.6);
    border-radius: 8px;
    overflow: hidden;
    min-height: 200px;
    border: 1px solid #e0e0e0;
}
#imagePreview {
    max-width: 100%;
    max-height: 400px;
    display: none;
    object-fit: contain;
}

.palette-section {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.palette-container {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: flex-start;
    gap: 10px;
}

.color-card {
    background: white;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    width: 60px;
}
.color-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.color-swatch {
    height: 40px;
    width: 100%;
}
.color-info {
    padding: 4px 2px;
    text-align: center;
}
.color-hex {
    font-weight: 600;
    color: var(--text-main);
    font-size: 11px;
    font-family: 'Consolas', monospace;
}

.actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    width: 100%;
    margin-top: 10px;
}
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    background-color: var(--primary);
    color: white;
    transition: background 0.3s, transform 0.1s;
}
.btn:hover { background-color: var(--primary-hover); }
.btn:active { transform: scale(0.96); }
.btn-secondary { background-color: #e5e5ea; color: var(--text-main); }
.btn-secondary:hover { background-color: #d1d1d6; }

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--text-main);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.toast.show {
    opacity: 1;
}
.hidden { display: none !important; }

.info-container {
    background: var(--bg-container);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    width: 98%;
    max-width: 1200px;
    box-sizing: border-box;
    z-index: 1;
    margin-top: 30px;
}
.info-container h2 {
    color: var(--text-main);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 22px;
}
.info-container p, .info-container li {
    color: var(--text-main);
    line-height: 1.6;
    margin-bottom: 10px;
    font-size: 15px;
}
.faq-item {
    border-bottom: 1px solid rgba(0,0,0,0.1);
    margin-bottom: 10px;
}
.faq-item:last-child {
    border-bottom: none;
}
.faq-question {
    width: 100%;
    max-width: none;
    margin: 0;
    background: none;
    border: none;
    text-align: left;
    padding: 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: inherit;
}
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}
.faq-answer p {
    padding-bottom: 15px;
    color: var(--text-muted);
    margin: 0;
}
.arrow {
    transition: transform 0.3s;
    font-size: 12px;
}
.faq-item.active .arrow {
    transform: rotate(180deg);
}
