/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    background: #000000 url('/bg-pattern.png') repeat;
    background-attachment: fixed;
    min-height: 100vh;
    color: #ffffff;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    color: white;
    line-height: 1.15;
}

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

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

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
    flex: 1;
    max-width: 960px;
    margin: 0 auto;
}

.input-section {
    padding: 30px;
}

.output-section {
    background: #1a1a1a;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 90%;
    z-index: 10;
}

/* Prompt Builder */
.prompt-builder {
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid #667eea;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.prompt-builder h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-weight: 700;
    font-size: 1.2rem;
}

.prompt-preview {
    background: #2a2a2a;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #ffffff;
    min-height: 60px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Form Sections */
.form-section {
    margin-bottom: 30px;
    border: 1px solid rgba(0, 0, 0, 1);
    border-radius: 6px;
    padding: 20px;
    background: #212121;
}

.form-section h4 {
    color: #ffffff;
    margin-bottom: 15px;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Collapsible Sections */
.collapsible-header {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 30px;
    transition: color 0.3s ease;
}

.collapsible-header:hover {
    color: #667eea;
}

.collapsible-header::after {
    content: '▼';
    position: absolute;
    right: 0;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.collapsible.expanded .collapsible-header::after {
    transform: rotate(-180deg);
}

.collapsible-content {
    overflow: hidden;
    transition: max-height 0.3s ease;
}

/* Style Grid */
.style-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.style-option {
    position: relative;
    cursor: pointer;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
}

.style-option:hover {
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.style-option.selected {
    border-color: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}

.style-option img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.style-label {
    display: block;
    text-align: center;
    padding: 12px;
    font-weight: 500;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.5);
}

.style-option.selected .style-label {
    background: rgba(102, 126, 234, 0.3);
    color: #667eea;
    font-weight: 700;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #ffffff;
    font-size: 0.95rem;
}

textarea,
select,
input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: #2a2a2a;
    color: #ffffff;
}

textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
    background: #2a2a2a;
}

small {
    display: block;
    margin-top: 6px;
    color: #cccccc;
    font-size: 0.85rem;
}

/* File Upload */
.file-upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
}

.file-upload-area:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.file-upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.file-upload-icon {
    font-size: 2rem;
}

.file-upload-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-upload-main {
    font-weight: 500;
    color: #ffffff;
}

.file-upload-sub {
    font-size: 0.85rem;
    color: #cccccc;
}

/* Multiple File Previews */
.file-previews {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    padding: 10px 0;
}

.file-preview-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.file-preview-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 8px;
}

.file-preview-item .file-name {
    font-size: 0.75rem;
    color: #cccccc;
    text-align: center;
    word-break: break-word;
    max-width: 100%;
}

.file-preview-item .remove-file {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.file-preview-item .remove-file:hover {
    background: #dc2626;
}

/* Legacy single file preview (keeping for compatibility) */
.file-preview {
    position: relative;
    display: inline-block;
}

.file-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    object-fit: cover;
}

.remove-file {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Email Collection Section */
.email-gate {
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid #667eea;
}

.email-description {
    color: #cccccc;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.email-form-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.email-form-group input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-size: 1rem;
    background: #2a2a2a;
    color: #ffffff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.email-form-group input[type="email"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.email-form-group input[type="email"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.consent-group {
    display: flex;
    align-items: flex-start;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #ffffff;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 2px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"]:disabled {
    cursor: not-allowed;
}

.btn-submit-email {
    padding: 12px 24px;
    background: #667eea;
    color: #ffffff;
    border: 2px solid #667eea;
    border-radius: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-submit-email:hover:not(:disabled) {
    background: #5568d3;
    border-color: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-submit-email:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.email-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.5);
    border-radius: 8px;
    color: #22c55e;
}

.status-icon {
    font-size: 1.2rem;
    font-weight: bold;
}

.status-text {
    font-size: 0.9rem;
}

.generate-hint {
    display: block;
    text-align: center;
    margin-top: 10px;
    color: #fbbf24;
    font-size: 0.85rem;
}

/* Buttons */
.btn-generate {
    width: 100%;
    background: #ffffff;
    color: #000000;
    border: 2px solid #ffffff;
    padding: 16px 24px;
    border-radius: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-generate:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.3);
    background: #f0f0f0;
}

.btn-generate:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-download {
    background: #ffffff;
    color: #000000;
    border: 2px solid #ffffff;
    padding: 12px 24px;
    border-radius: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.3);
    background: #f0f0f0;
}

.btn-secondary {
    background: transparent;
    color: #ffffff;
    border: 2px solid #ffffff;
    padding: 12px 24px;
    border-radius: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}



/* Full Screen Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loading-text {
    color: white;
    font-size: 1.2rem;
    font-weight: 500;
    text-align: center;
}

/* Big Loader Animation */
.loader {
  width: 55px;
  aspect-ratio: 1;
  --g1:conic-gradient(from  90deg at top    3px left  3px,#0000 90deg,#fff 0);
  --g2:conic-gradient(from -90deg at bottom 3px right 3px,#0000 90deg,#fff 0);
  background:
    var(--g1),var(--g1),var(--g1),var(--g1), 
    var(--g2),var(--g2),var(--g2),var(--g2);
  background-position: 0 0,100% 0,100% 100%,0 100%;
  background-size: 25px 25px;
  background-repeat: no-repeat;
  animation: l11 1.5s infinite;
}
@keyframes l11 {
  0%   {background-size:35px 15px,15px 15px,15px 35px,35px 35px}
  25%  {background-size:35px 35px,15px 35px,15px 15px,35px 15px}
  50%  {background-size:15px 35px,35px 35px,35px 15px,15px 15px}
  75%  {background-size:15px 15px,35px 15px,35px 35px,15px 35px}
  100% {background-size:35px 15px,15px 15px,15px 35px,35px 35px}
}

/* Output Section */
.result-container h3 {
    margin-bottom: 20px;
    color: #ffffff;
    font-weight: 700;
}

.image-result {
    text-align: center;
}

.image-result img {
    max-width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
}

.image-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.revised-prompt {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.revised-prompt h4 {
    margin-bottom: 8px;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
}

.revised-prompt p {
    color: #cccccc;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Error Message */
.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    padding: 20px;
}

.error-content h4 {
    color: #dc2626;
    margin-bottom: 8px;
    font-weight: 700;
}

.error-content p {
    color: #7f1d1d;
}

/* Placeholder */
.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
}

.placeholder-content {
    text-align: center;
    color: #cccccc;
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.placeholder-content h3 {
    margin-bottom: 10px;
    color: #ffffff;
    font-weight: 700;
}

.placeholder-content p {
    margin-bottom: 20px;
}

/* Placeholder Info Section */
.placeholder-info {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.placeholder-info h4 {
    color: #ffffff;
    margin-bottom: 12px;
    font-size: 1rem;
    font-weight: 700;
}

.placeholder-info ul {
    list-style: none;
    padding: 0;
}

.placeholder-info li {
    padding: 6px 0;
    color: #cccccc;
    font-size: 0.9rem;
    position: relative;
    padding-left: 20px;
}

.placeholder-info li:before {
    content: "•";
    color: #667eea;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: rgba(255, 255, 255, 0.8);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
    }

    .style-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }

    .style-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .style-option img {
        height: 150px;
    }

    .header h1 {
        font-size: 2rem;
    }
    
    .container {
        padding: 15px;
    }
    
    .input-section,
    .output-section {
        padding: 20px;
    }
    
    .image-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .file-previews {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .file-preview-item img {
        width: 80px;
        height: 80px;
    }
    
    .form-section {
        padding: 15px;
    }
    
    .prompt-builder {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .btn-generate {
        font-size: 1rem;
        padding: 14px 20px;
    }

    .style-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .style-option img {
        height: 180px;
    }

    .style-label {
        padding: 10px;
        font-size: 0.9rem;
    }

    .file-previews {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    
    .file-preview-item img {
        width: 70px;
        height: 70px;
    }
    
    .form-section {
        padding: 10px;
        margin-bottom: 20px;
    }
    
    .prompt-preview {
        font-size: 0.8rem;
        padding: 12px;
    }
}

/* Animation for smooth transitions */
.result-container,
.error-message {
    animation: fadeIn 0.5s ease-in-out;
}

.prompt-preview {
    transition: all 0.3s ease;
}

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