@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

:root {
    --bg-main: #0d0d0d;
    --bg-panel: #1a1a1a;
    --bg-panel-hover: #222222;
    --text-main: #ffffff;
    --text-muted: #888888;
    --accent: #6b4cff;
    --accent-hover: #583be8;
    --border-color: #333333;
    --error-color: #ff6b6b;
}

.pti-container {
    max-width: 1200px;
    margin: 0 auto;
    font-family: 'Pretendard', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-main);
    padding: 40px 20px;
    border-radius: 12px;
}

.pti-header {
    text-align: center;
    margin-bottom: 40px;
}

.pti-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #fff, #aaa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pti-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.pti-content {
    display: flex;
    gap: 30px;
    align-items: stretch;
}

.pti-panel {
    flex: 1;
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    display: flex;
    flex-direction: column;
}

.panel-header {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
}

.step-num {
    background-color: #333;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: bold;
    margin-right: 12px;
}

.panel-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.input-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

textarea {
    width: 100%;
    height: 100%;
    min-height: 250px;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    color: var(--text-main);
    font-size: 1.1rem;
    line-height: 1.6;
    resize: none;
    outline: none;
    transition: border-color 0.3s;
}

textarea:focus {
    border-color: var(--accent);
}

.action-area {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ratio-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #222;
    padding: 10px 18px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.ratio-selector label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.ratio-selector select {
    background: transparent;
    color: var(--text-main);
    border: none;
    outline: none;
    font-size: 0.95rem;
    cursor: pointer;
    font-family: inherit;
}

.ratio-selector select option {
    background: var(--bg-panel);
    color: var(--text-main);
}

.btn-generate {
    background-color: var(--accent);
    color: #fff;
    border: none;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-generate:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(107, 76, 255, 0.3);
}

.btn-generate:disabled {
    background-color: #555;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.result-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    min-height: 350px;
    overflow: hidden;
    position: relative;
}

.empty-state, .loading-state {
    text-align: center;
    color: var(--text-muted);
}

.empty-state svg, .loading-state svg {
    margin-bottom: 15px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.result-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.error-msg {
    color: var(--error-color);
    font-weight: 500;
    text-align: center;
    padding: 20px;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 8px;
    width: 100%;
}

#generatedImg {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    margin-bottom: 20px;
}

.result-actions {
    display: flex;
    gap: 15px;
}

.btn-action {
    background-color: #333;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-action:hover {
    background-color: #444;
}

@media (max-width: 900px) {
    .pti-content {
        flex-direction: column;
    }
}
