/* 기본 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --success: #48bb78;
    --danger: #f56565;
    --warning: #ed8936;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-bg: #ffffff;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --border: #e2e8f0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: 2rem 1rem;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

/* 헤더 */
.header {
    text-align: center;
    color: white;
    margin-bottom: 3rem;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
}

/* 카드 */
.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input[type="url"],
.form-group input[type="text"],
.form-group input[type="datetime-local"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-group input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.5rem;
    cursor: pointer;
}

/* 버튼 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--bg-gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: #f7fafc;
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    background: #edf2f7;
}

.btn-copy {
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    white-space: nowrap;
}

.btn-copy:hover {
    background: var(--primary-dark);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

button[type="submit"] {
    width: 100%;
    margin-top: 1rem;
}

/* 결과 섹션 */
.result-card {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.result-card h2 {
    color: white;
}

.result-content {
    margin-top: 1.5rem;
}

.short-url-box {
    margin-bottom: 1.5rem;
}

.short-url-box label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.url-display {
    display: flex;
    gap: 0.5rem;
}

.url-display input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    font-family: 'Courier New', monospace;
}

.qr-code-container {
    text-align: center;
    margin: 1.5rem 0;
}

.qr-code-container label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 600;
}

.qr-code-container img {
    max-width: 300px;
    width: 100%;
    border-radius: 8px;
    background: white;
    padding: 1rem;
    margin-bottom: 1rem;
}

.result-info {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin: 1.5rem 0;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
}

.info-value {
    font-family: 'Courier New', monospace;
    word-break: break-all;
}

/* 목록 섹션 */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.url-list {
    max-height: 500px;
    overflow-y: auto;
}

.url-item {
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    transition: all 0.3s;
}

.url-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.url-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.5rem;
}

.url-item-title {
    flex: 1;
    font-weight: 600;
    color: var(--primary);
    word-break: break-all;
}

.url-item-actions {
    display: flex;
    gap: 0.5rem;
}

.url-item-original {
    color: var(--text-secondary);
    font-size: 0.875rem;
    word-break: break-all;
    margin-bottom: 0.5rem;
}

.url-item-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* 푸터 */
.footer {
    text-align: center;
    color: white;
    margin-top: 3rem;
    padding: 2rem 0;
    opacity: 0.9;
}

/* 토스트 */
.toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

.toast.warning {
    background: var(--warning);
}

/* 반응형 */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .header h1 {
        font-size: 2rem;
    }

    .card {
        padding: 1.5rem;
    }

    .url-display {
        flex-direction: column;
    }

    .toast {
        right: 1rem;
        left: 1rem;
    }

    .list-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .url-item-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .url-item-actions {
        justify-content: flex-start;
    }
}

/* 스크롤바 스타일 */
.url-list::-webkit-scrollbar {
    width: 8px;
}

.url-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.url-list::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.url-list::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}
