/**
 * Styles for AI Paper Decoration Maker
 * Inspired by Figma design
 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(to bottom right, #faf5ff 0%, #fdf2f8 50%, #eff6ff 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 16px;
}

.content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 8px;
}

.header-icon {
    font-size: 40px;
    margin-bottom: 16px;
}

.header h1 {
    font-size: 48px;
    font-weight: 700;
    color: #9333ea;
    margin-bottom: 12px;
}

.subtitle {
    font-size: 18px;
    color: #6b7280;
}

/* Form Card */
.form-card {
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    padding: 32px;
    margin-bottom: 32px;
}

/* Inline Form */
.inline-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    margin-bottom: 24px;
    color: #374151;
}

.form-text {
    white-space: nowrap;
}

.autocomplete-wrapper {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.autocomplete-wrapper.purple .autocomplete-input {
    border-color: #c084fc;
}

.autocomplete-wrapper.purple .autocomplete-input:focus {
    border-color: #9333ea;
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.1);
}

.autocomplete-wrapper.pink .autocomplete-input {
    border-color: #f9a8d4;
}

.autocomplete-wrapper.pink .autocomplete-input:focus {
    border-color: #ec4899;
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.1);
}

.autocomplete-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 24px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.2s ease;
    background: white;
    font-family: inherit;
}

.autocomplete-input:focus {
    outline: none;
    background: white;
}

.inline-input {
    font-size: 24px;
    padding: 8px 16px;
}

.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 12px 12px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.suggestions-dropdown.show {
    display: block;
}

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid #f3f4f6;
    font-size: 18px;
}

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

.suggestion-item:hover {
    background: #f9fafb;
}

.autocomplete-wrapper.purple .suggestions-dropdown {
    border-color: #c084fc;
}

.autocomplete-wrapper.purple .suggestion-item:hover {
    background: #faf5ff;
}

.autocomplete-wrapper.pink .suggestions-dropdown {
    border-color: #f9a8d4;
}

.autocomplete-wrapper.pink .suggestion-item:hover {
    background: #fdf2f8;
}

/* Style Selection */
.style-selection-inline {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.style-option {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 12px;
    border-radius: 12px;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 200px;
}

.style-option:hover {
    background: #f9fafb;
}

.style-option input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #9333ea;
}

.style-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.style-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.style-description {
    font-size: 14px;
    color: #6b7280;
}

/* Generate Button */
.generate-btn {
    width: 100%;
    background: linear-gradient(to right, #9333ea, #ec4899);
    color: white;
    border: none;
    padding: 16px 24px;
    font-size: 20px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 15px -3px rgba(147, 51, 234, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.generate-btn:hover:not(:disabled) {
    background: linear-gradient(to right, #7e22ce, #db2777);
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(147, 51, 234, 0.4);
}

.generate-btn:active:not(:disabled) {
    transform: translateY(0);
}

.generate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-icon {
    font-size: 24px;
}

/* Loading Section */
.loading-section {
    display: flex;
    justify-content: center;
    animation: fadeIn 0.3s ease-in;
}

.loading-card {
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    padding: 48px 32px;
    text-align: center;
    min-width: 300px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f3f4f6;
    border-top-color: #9333ea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

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

.loading-text {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.loading-subtext {
    font-size: 14px;
    color: #6b7280;
}

/* Result Section */
.result-section {
    animation: fadeIn 0.5s ease-in;
}

.result-card {
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    padding: 24px;
    transition: transform 0.2s ease;
}

.result-card:hover {
    transform: scale(1.01);
}

.result-header {
    margin-bottom: 20px;
    text-align: center;
}

.result-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.result-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.purple-text {
    color: #9333ea;
}

.pink-text {
    color: #ec4899;
}

.result-separator {
    color: #6b7280;
}

.result-style {
    font-size: 14px;
    color: #6b7280;
}

.image-container {
    background: #f9fafb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.instruction-text {
    font-size: 16px;
    color: #4b5563;
    margin: 20px 0;
    text-align: center;
    line-height: 1.6;
}

.action-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.download-btn {
    background: linear-gradient(to right, #9333ea, #ec4899);
    color: white;
}

.download-btn:hover {
    background: linear-gradient(to right, #7e22ce, #db2777);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(147, 51, 234, 0.3);
}

.print-btn {
    background: linear-gradient(to right, #9333ea, #ec4899);
    color: white;
}

.print-btn:hover {
    background: linear-gradient(to right, #7e22ce, #db2777);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(147, 51, 234, 0.3);
}

.generate-another-btn {
    background: white;
    color: #9333ea;
    border: 2px solid #c084fc;
}

.generate-another-btn:hover {
    background: #faf5ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(147, 51, 234, 0.2);
}

.btn-icon-small {
    font-size: 18px;
}

/* Error Section */
.error-section {
    animation: fadeIn 0.3s ease-in;
}

.error-card {
    background: #fef2f2;
    border: 2px solid #fecaca;
    border-radius: 24px;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.error-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.error-content {
    flex: 1;
}

.error-title {
    font-size: 18px;
    font-weight: 600;
    color: #991b1b;
    margin-bottom: 4px;
}

.error-message {
    color: #7f1d1d;
    font-size: 16px;
}

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

    .subtitle {
        font-size: 16px;
    }

    .form-card {
        padding: 24px;
    }

    .inline-form {
        font-size: 20px;
        flex-direction: column;
        align-items: stretch;
    }

    .form-text {
        text-align: center;
    }

    .autocomplete-input,
    .inline-input {
        font-size: 20px;
    }

    .style-selection-inline {
        flex-direction: column;
    }

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

    .action-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: 16px 8px;
    }

    .header h1 {
        font-size: 28px;
    }

    .inline-form {
        font-size: 18px;
    }

    .autocomplete-input,
    .inline-input {
        font-size: 18px;
    }
}
