/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    font-family: 'Arial', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Dream input styles */
.dream-input-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dream-input {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    resize: vertical;
    transition: all 0.3s ease;
}

.dream-input:focus {
    outline: none;
    border-color: rgba(167, 139, 250, 0.5);
    box-shadow: 0 0 15px rgba(167, 139, 250, 0.2);
}

/* Tags styles */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.tag {
    padding: 0.5rem 1rem;
    background: rgba(167, 139, 250, 0.2);
    border: 1px solid rgba(167, 139, 250, 0.3);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.tag:hover {
    background: rgba(167, 139, 250, 0.3);
    transform: translateY(-2px);
}

.tag.active {
    background: rgba(167, 139, 250, 0.4);
    border-color: rgba(167, 139, 250, 0.6);
    transform: scale(1.05);
}

/* Generate button */
.generate-btn {
    padding: 1rem 2rem;
    background: linear-gradient(45deg, #a78bfa, #8b5cf6);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: center;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.3);
}

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

/* Dream result styles */
.dream-result {
    min-height: 300px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.dream-result video {
    max-width: 100%;
    border-radius: 10px;
    transition: opacity 0.5s ease;
}

.dream-result.loading {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(167, 139, 250, 0.3);
    border-top: 3px solid rgba(167, 139, 250, 1);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    text-align: center;
}

.loading-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #a78bfa, #8b5cf6);
    width: 0%;
    transition: width 0.3s ease;
}

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

/* History section */
.history-section {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.history-section h3 {
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.8);
}

.history-item {
    padding: 0.8rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: rgba(0, 0, 0, 0.3);
    transform: translateX(5px);
}

/* Error message */
.error-message {
    color: #ff6b6b;
    text-align: center;
    padding: 1rem;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 10px;
    margin: 1rem 0;
}

/* Save button */
.save-dream-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(167, 139, 250, 0.8);
    border: none;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    z-index: 10;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s forwards;
}

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

.save-dream-btn:hover {
    background: rgba(167, 139, 250, 1);
    transform: translateY(-2px);
}

.save-dream-btn:disabled {
    background: rgba(167, 139, 250, 0.4);
    cursor: not-allowed;
    transform: none;
}
