:root {
    --primary-color: #3b82f6;
    --success-color: #10b981;
    --reset-color: #ef4444;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    background-color: #f3f4f6;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

.container {
    text-align: center;
    padding: 30px 20px;
    width: 100%;
    max-width: 500px;
}

h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 25px;
    color: #111;
}

/* Settings Panel */
.settings-panel {
    background-color: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.guide-text {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: -5px;
    margin-bottom: 5px;
    font-weight: 400;
}

#size-select {
    padding: 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.85rem;
    flex: 2;
}

.btn-row {
    display: flex;
    gap: 8px;
}

.bg-color-btn {
    flex: 1;
    padding: 8px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    background: white;
}

.bg-color-btn.active {
    border-color: var(--primary-color);
    background-color: #eff6ff;
}

.style-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-row.mini {
    gap: 5px;
}

.style-btn {
    padding: 8px 15px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.style-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

#logo-color {
    border: none;
    width: 40px;
    height: 38px;
    padding: 0;
    background: none;
    cursor: pointer;
}

#logo-color::-webkit-color-swatch-wrapper {
    padding: 0;
}

#logo-color::-webkit-color-swatch {
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

/* Button Styles */
.upload-btn {
    background-color: var(--primary-color);
    color: white;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    text-align: center;
}

.upload-btn-outline {
    border: 1px dashed var(--primary-color);
    color: var(--primary-color);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    text-align: center;
}

#photo-upload { display: none; }

/* Frame Design */
.frame-container {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
}

.photo-strip {
    position: relative;
    width: 100%;
    max-width: 320px;
    padding: 16px;
    border-radius: 2px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
    z-index: 1;
}

.photo-strip.bg-black { background-color: #1a1a1a; }
.photo-strip.bg-white { background-color: #ffffff; }
.photo-strip.bg-white .strip-footer,
.photo-strip.bg-white .brand-logo,
.photo-strip.bg-white .current-date {
    color: #1a1a1a;
}
.photo-strip.bg-white .strip-footer {
    border-top-color: rgba(0,0,0,0.1);
}

/* Custom Background Layer */
.slider-group {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#blur-slider {
    width: 100%;
    cursor: pointer;
}

#bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.2); /* Subtle dark overlay */
    z-index: -1;
    pointer-events: none;
    transition: background-color 0.3s;
}

.photo-strip.bg-white #bg-overlay {
    background-color: rgba(255, 255, 255, 0.1); /* Lighter overlay for white frame */
}

/* Ensure background layer can take filters */
#custom-bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-size: cover;
    background-position: center;
    transition: filter 0.2s;
}

.photo-slot {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
    background-color: rgba(34, 34, 34, 0.5);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.photo-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.strip-footer {
    position: relative;
    padding: 20px 0 10px 0;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.brand-logo {
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: 2px;
    transition: font-family 0.2s;
}

.current-date {
    font-size: 0.75rem;
    opacity: 0.8;
}

.footer-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.reset-btn, .download-btn {
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    border: none;
    color: white;
}

.reset-btn { background-color: var(--reset-color); }
.download-btn { background-color: var(--success-color); }

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.85);
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    padding: 25px;
    border-radius: 16px;
    width: 90%;
    max-width: 550px;
}

.cropper-container {
    max-height: 55vh;
    margin: 20px 0;
    overflow: hidden;
}

.modal-btns {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-primary { background-color: var(--primary-color); color: white; border: none; padding: 10px 24px; border-radius: 8px; cursor: pointer; }
.btn-secondary { background-color: #f3f4f6; color: #4b5563; border: none; padding: 10px 24px; border-radius: 8px; cursor: pointer; }

#cropper-image { max-width: 100%; display: block; }
