:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #6366f1;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    --card-bg: rgba(255, 255, 255, 0.9);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --radius-lg: 16px;
    --radius-md: 12px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

body {
    font-family: 'Inter', 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Premium Container */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Glassmorphism Header */
.app-header {
    text-align: center;
    margin-bottom: 60px;
    animation: fadeInDown 0.8s ease-out;
}

.app-header h1 {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(to right, #4f46e5, #9333ea);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 16px;
    letter-spacing: -0.025em;
}

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

/* Modern Grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
    margin-top: 40px;
}

/* Premium Card */
.premium-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-lg);
    padding: 40px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.premium-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #4f46e5, #9333ea);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.premium-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-xl);
    border-color: rgba(79, 70, 229, 0.2);
}

.premium-card:hover::before {
    transform: scaleX(1);
}

.card-icon {
    font-size: 3.5rem;
    margin-bottom: 24px;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.1));
    transition: transform 0.4s ease;
}

.premium-card:hover .card-icon {
    transform: scale(1.2) rotate(5deg);
}

.premium-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #0f172a;
}

.premium-card p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Modern Input Form */
.input-form-container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 50px;
    animation: fadeInUp 0.8s ease-out;
}

.form-section {
    margin-bottom: 40px;
    padding: 30px;
    background: #f8fafc;
    border-radius: var(--radius-md);
    border: 1px solid #e2e8f0;
}

.form-section h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid transparent;
    display: inline-block;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #334155;
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

/* Responsive Grid Utilities */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Premium Buttons */
.btn-group {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 40px;
}

.btn-premium {
    padding: 14px 32px;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background: linear-gradient(to right, #4f46e5, #6366f1);
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.4);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(to right, #10b981, #059669);
    color: white;
}

.btn-success:hover {
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(to right, #ef4444, #dc2626);
    color: white;
}

.btn-danger:hover {
    box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.4);
    transform: translateY(-2px);
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 768px) {
    .app-header { margin-bottom: 30px; }
    .app-header h1 { font-size: 1.8rem; }
    .app-header p { font-size: 1rem; }
    
    .app-container { padding: 20px 10px; }
    
    .input-form-container { 
        padding: 20px 15px; 
        border-radius: var(--radius-md);
    }
    
    .form-section {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .card-grid { grid-template-columns: 1fr; gap: 20px; }
    
    .btn-premium {
        width: 100%;
        padding: 12px 20px;
    }
    
    .btn-group {
        flex-direction: column;
        gap: 10px;
    }

    .preview-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -10px;
        padding: 0 10px;
        justify-content: flex-start !important;
    }

    .container {
        width: 794px; /* Maintain A4 width for the internal preview */
        margin: 0;
    }
}
