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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.step {
    padding: 40px;
    display: none;
}

.step.active {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

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

h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

input[type="text"] {
    flex: 1;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

button {
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

button:active {
    transform: translateY(0);
}

.next-btn {
    width: 100%;
    margin-top: 20px;
}

.link-box {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.link-box a {
    flex: 1;
    color: #667eea;
    text-decoration: none;
    word-break: break-all;
    font-weight: 500;
}

.link-box a:hover {
    text-decoration: underline;
}

.hidden {
    display: none !important;
}

/* Loading spinner */
#loadingSection {
    text-align: center;
    padding: 40px 20px;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loadingText {
    color: #667eea;
    font-size: 1.1rem;
    font-weight: 500;
}

/* Alert boxes */
.alert {
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.alert-warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
}

.alert strong {
    display: block;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.alert p {
    margin: 5px 0;
}

.instructions {
    background: #f8f9ff;
    border-left: 4px solid #667eea;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.instructions ol {
    margin-left: 20px;
}

.instructions li {
    margin: 10px 0;
}

kbd {
    background: #333;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9rem;
}

textarea {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.9rem;
    resize: vertical;
    margin-bottom: 20px;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.action-buttons button {
    flex: 1;
    min-width: 150px;
}

.print-btn {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.preview {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    background: white;
    min-height: 300px;
    max-height: 800px;
    overflow-y: auto;
}

footer {
    text-align: center;
    color: white;
    padding: 20px;
    margin-top: 20px;
}

/* Print styles */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .container {
        box-shadow: none;
    }

    header,
    footer,
    .action-buttons,
    #step1,
    #step2 {
        display: none !important;
    }

    #step3 {
        display: block !important;
    }

    .preview {
        border: none;
        max-height: none;
        overflow: visible;
    }

    h2 {
        display: none;
    }
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }

    .step {
        padding: 20px;
    }

    .input-group {
        flex-direction: column;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons button {
        width: 100%;
    }
}
