/* style.css from doc *//* assets/css/style.css */

/* CSS Variables */
:root {
    /* Red Theme Colors */
    --red-50: #fef2f2;
    --red-100: #fee2e2;
    --red-200: #fecaca;
    --red-300: #fca5a5;
    --red-400: #f87171;
    --red-500: #ef4444;
    --red-600: #dc2626;
    --red-700: #b91c1c;
    --red-800: #991b1b;
    --red-900: #7f1d1d;
    
    /* Glassmorphism Properties */
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
    --glass-blur: blur(16px);
    
    /* Transitions */
    --transition-fast: 200ms;
    --transition-normal: 300ms;
    --transition-slow: 500ms;
    
    /* Light Mode Colors */
    --bg-primary: linear-gradient(135deg, #fef2f2 0%, #ffffff 50%, #fee2e2 100%);
    --text-primary: #374151;
    --text-secondary: #6b7280;
}

/* Dark Mode Variables */
.dark-mode {
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    --bg-primary: linear-gradient(135deg, #7f1d1d 0%, #1f2937 50%, #000000 100%);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    position: relative;
    transition: all var(--transition-normal) ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Background Elements */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.circle {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--red-600), var(--red-400));
    opacity: 0.1;
    animation: float 6s ease-in-out infinite;
}

.circle-1 {
    width: 300px;
    height: 300px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.circle-2 {
    width: 200px;
    height: 200px;
    top: 60%;
    right: 10%;
    animation-delay: 2s;
}

.circle-3 {
    width: 250px;
    height: 250px;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

/* Header */
.header {
    padding: 1.5rem 0;
    position: relative;
    z-index: 10;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--red-600), var(--red-800));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-icon {
    padding: 0.75rem 1rem;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast) ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-icon:hover {
    background: rgba(220, 38, 38, 0.1);
    border-color: var(--red-500);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.15);
}

/* Main Content */
.main-content {
    padding: 2rem 0;
    position: relative;
    z-index: 1;
}

/* Alert Messages */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 2rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    color: #166534;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.dark-mode .alert-success {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.dark-mode .alert-error {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* Generator Container */
.generator-container {
    padding: 2.5rem;
    margin-bottom: 2rem;
    border-radius: 1.5rem;
}

.generator-form {
    max-width: 600px;
    margin: 0 auto;
}

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

.form-label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-container {
    position: relative;
}

.form-input,
.form-select {
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(220, 38, 38, 0.2);
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition-fast) ease;
    outline: none;
}

.form-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.form-input:focus,
.form-select:focus {
    border-color: var(--red-500);
    box-shadow: 
        0 0 0 3px rgba(220, 38, 38, 0.1),
        0 4px 12px rgba(220, 38, 38, 0.15);
    background: rgba(255, 255, 255, 0.8);
}

.dark-mode .form-input,
.dark-mode .form-select {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(220, 38, 38, 0.3);
}

.dark-mode .form-input:focus,
.dark-mode .form-select:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--red-400);
}

/* Surprise Button */
.btn-surprise {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--red-500), var(--red-600));
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast) ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-surprise:hover {
    background: linear-gradient(135deg, var(--red-600), var(--red-700));
    transform: translateY(-50%) scale(1.05);
}

/* Character Count */
.character-count {
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Generate Button */
.btn-generate {
    width: 100%;
    padding: 1.25rem 2rem;
    background: linear-gradient(135deg, var(--red-600), var(--red-700));
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 4px 15px rgba(220, 38, 38, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all var(--transition-normal) ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-generate::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        transparent 100%);
    transition: left 0.5s ease;
}

.btn-generate:hover {
    background: linear-gradient(135deg, var(--red-700), var(--red-800));
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(220, 38, 38, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-generate:hover::before {
    left: 100%;
}

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

.btn-generate:disabled {
    background: linear-gradient(135deg, #9ca3af, #6b7280);
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

.btn-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Image Result */
.image-result {
    padding: 2rem;
    border-radius: 1.5rem;
    margin-bottom: 2rem;
}

.image-card {
    max-width: 600px;
    margin: 0 auto;
    border-radius: 1rem;
    overflow: hidden;
    position: relative;
    group: hover;
}

.image-container {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 1rem;
}

.generated-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow) ease;
}

.image-card:hover .generated-image {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(0, 0, 0, 0.3) 50%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity var(--transition-normal) ease;
    display: flex;
    align-items: end;
    padding: 1.5rem;
}

.image-card:hover .image-overlay {
    opacity: 1;
}

.image-actions {
    display: flex;
    gap: 0.75rem;
    transform: translateY(20px);
    transition: transform var(--transition-normal) ease;
}

.image-card:hover .image-actions {
    transform: translateY(0);
}

.btn-action {
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast) ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-action:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.image-info {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
}

.image-prompt {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.image-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
}

.style-tag {
    background: linear-gradient(135deg, var(--red-100), var(--red-200));
    color: var(--red-700);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dark-mode .style-tag {
    background: linear-gradient(135deg, var(--red-900), var(--red-800));
    color: var(--red-300);
}

.timestamp {
    color: var(--text-secondary);
}

/* Animations */
.fade-in {
    animation: fadeIn 0.6s ease-in-out;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .logo {
        font-size: 1.75rem;
    }
    
    .generator-container {
        padding: 1.5rem;
    }
    
    .btn-generate {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
    
    .image-result {
        padding: 1.5rem;
    }
    
    .image-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-action {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .form-input {
        padding-right: 5rem; /* Make room for surprise button */
    }
    
    .btn-surprise {
        padding: 0.25rem 0.5rem;
        font-size: 0.625rem;
        right: 0.25rem;
    }
    
    .circle {
        display: none; /* Hide background circles on very small screens */
    }
}

.input-container {
  position: relative;
  width: 100%;
}

.textarea-wrapper {
  position: relative;
  width: 100%;
}

.form-input.glass-input {
  width: 100%;
  padding: 12px 45px 12px 12px; /* space for button */
  border-radius: 12px;
  resize: vertical;
  min-height: 80px;
  box-sizing: border-box;
}

.btn-surprise {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: #6c63ff;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.3s ease;
}

.btn-surprise:hover {
  background: #574fe0;
}
