@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@700&family=Noto+Sans+KR:wght@400;500;700&display=swap');

:root {
    --sky-blue-light: #87CEEB;
    --sky-blue-dark: #6495ED;
    --white-color: #FFFFFF;
    --text-dark: #333;
    --text-light: #555;
    --border-color: rgba(255, 255, 255, 0.5);
    --shadow-color: rgba(0, 0, 0, 0.1);
    --cursive-font: 'Dancing Script', cursive;
    --body-font: 'Noto Sans KR', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--body-font);
    background: linear-gradient(to bottom, var(--sky-blue-light), var(--white-color));
    height: 100vh;
    overflow: hidden;
    color: var(--text-dark);
}

.app-container {
    display: flex;
    height: 100%;
}

/* Editor Panel (Left) */
.editor-panel {
    width: 450px;
    height: 100%;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
}

.editor-panel header h1 {
    font-family: var(--cursive-font);
    color: var(--sky-blue-dark);
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

.form-section h2 {
    font-family: var(--body-font);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.form-section h2 .step {
    background: var(--sky-blue-dark);
    color: var(--white-color);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-right: 0.5rem;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.search-container {
    display: flex;
}

input[type="search"],
input[type="url"] {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px 0 0 8px;
    background: rgba(255, 255, 255, 0.7);
    outline: none;
}

#search-btn {
    padding: 0.8rem 1rem;
    border: none;
    background: var(--sky-blue-dark);
    color: var(--white-color);
    border-radius: 0 8px 8px 0;
    cursor: pointer;
}

#story {
    width: 100%;
    height: 100px;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.7);
    resize: vertical;
}

.playlist-items {
    list-style: none;
    min-height: 100px;
    padding: 0.5rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.6);
}

.playlist-items li {
    background: var(--white-color);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 4px var(--shadow-color);
    cursor: grab;
}

#play-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    background: var(--sky-blue-dark);
    color: var(--white-color);
    cursor: pointer;
    margin-top: 1rem;
}

#search-results li {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    background: white;
    margin-top: 0.5rem;
    border-radius: 4px;
}
#search-results button {
    margin-left:auto;
    background: var(--sky-blue-dark);
    color: white;
    border:none;
    padding: 5px;
    border-radius: 4px;
}


/* Player Panel (Right) */
.player-panel {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

.player-view {
    width: 100%;
    max-width: 960px;
    height: 90%;
    background: var(--white-color);
    box-shadow: 0 10px 30px var(--shadow-color);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
}

.image-display {
    flex-grow: 1;
    background-size: cover;
    background-position: center;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: center;
    align-items: center;
    color: rgba(0,0,0,0.3);
    font-size: 2rem;
    font-weight: 700;
}

.story-display {
    padding: 1.5rem 2rem;
    height: 120px;
    overflow-y: auto;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-light);
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.player-wrapper {
    width: 100%;
    height: auto;
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

#player {
    width: 200px;
    height: 113px; /* 16:9 aspect ratio */
    flex-shrink: 0;
}

/* Cloud Animation */
@keyframes move-clouds-back {
    from {background-position:0 0;}
    to {background-position:10000px 0;}
}

body::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    background-image: url(https://storage.googleapis.com/gemini-agile-prod-assets/cloud.png), url(https://storage.googleapis.com/gemini-agile-prod-assets/cloud.png);
    background-repeat: repeat-x;
    background-position: 0px 5%, 0px 15%;
    background-size: 1000px, 800px;
    opacity: 0.3;
    animation: move-clouds-back 200s linear infinite;
    z-index: -1;
}

@media (max-width: 1200px) {
    .app-container {
        flex-direction: column;
    }
    .editor-panel {
        width: 100%;
        height: 50vh;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    .player-panel {
        height: 50vh;
        padding: 1rem;
    }
    .player-view {
        height: 100%;
    }
}
