/**
 * @license
 * SPDX-License-Identifier: Apache-2.0
 */

/* App-specific styles that extend landing.css */

/* Main layout adjustments for app */
main.container {
    padding: 2rem;
    max-width: 1400px;
}

/* Intro section */
.intro {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.intro h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #00B4D8; /* Bright blue matching favicon */
}

.intro p {
    color: var(--text-secondary-color);
    font-size: 1.1rem;
}

/* Editor panel */
.editor-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
    max-width: 400px;
}

/* Upload box with futuristic style */
.upload-box {
    background: var(--surface-color);
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upload-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(8, 217, 214, 0.1), transparent);
    transition: left 0.5s ease;
}

.upload-box:hover {
    border-color: var(--secondary-accent-color);
    box-shadow: var(--accent-glow);
    transform: translateY(-2px);
}

.upload-box:hover::before {
    left: 100%;
}

.upload-box.dragging {
    border-color: var(--primary-color);
    background-color: rgba(59, 130, 246, 0.1);
}

.upload-box img {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.upload-box p {
    margin: 0.5rem 0;
}

.upload-box small {
    color: var(--text-secondary-color);
    font-size: 0.875rem;
}

/* Image preview */
.image-preview {
    position: relative;
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    border: 1px solid var(--border-color);
}

.image-preview img {
    width: 100%;
    height: auto;
    border-radius: calc(var(--border-radius) - 4px);
}

.image-preview button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    transition: all 0.2s ease;
}

.image-preview button:hover {
    background: var(--error-color);
    transform: scale(1.1);
}

/* Text input */
.text-input-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.text-input-container label {
    font-weight: 600;
    color: var(--text-primary-color);
}

.text-input-container input {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    color: var(--text-primary-color);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.text-input-container input:focus {
    outline: none;
    border-color: var(--secondary-accent-color);
    box-shadow: 0 0 0 3px rgba(8, 217, 214, 0.1);
}

.text-input-container input::placeholder {
    color: var(--text-secondary-color);
}

/* Generate button with enhanced style */
#generate-button {
    background: #00B4D8; /* Bright blue matching favicon */
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#generate-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

#generate-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 180, 216, 0.4);
    background: #0096C7; /* Darker blue on hover */
}

#generate-button:hover:not(:disabled)::before {
    width: 300px;
    height: 300px;
}

#generate-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Result section */
.result-section {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
}

#result-placeholder {
    text-align: center;
    color: var(--text-secondary-color);
}

#result-placeholder img {
    width: 100px;
    opacity: 0.3;
    margin-bottom: 1rem;
}

/* Result images */
#result-image-container {
    display: flex;
    gap: 1rem;
    width: 100%;
}

.result-column {
    flex: 1;
}

.result-column h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary-color);
    margin-bottom: 0.5rem;
}

.result-column img {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

/* Loader */
#loader {
    text-align: center;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#loader p {
    display: block !important;
    width: 100% !important;
    margin: 0.5rem 0;
    word-wrap: break-word;
    max-width: 100%;
    text-align: center !important;
}

.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--secondary-accent-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Error message */
#error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error-color);
    color: var(--error-color);
    padding: 1rem;
    border-radius: var(--border-radius);
    text-align: center;
}

/* Pricing section for app page */
.pricing-section {
    background: transparent;
    padding: 3rem 0;
}

/* Responsive design */
@media (max-width: 992px) {
    .editor-panel {
        grid-template-columns: 1fr;
    }
    
    .result-section {
        margin-top: 2rem;
    }
}

@media (max-width: 768px) {
    .intro h2 {
        font-size: 1.8rem;
    }
    
    main.container {
        padding: 1rem;
    }
    
    #result-image-container {
        flex-direction: column;
    }
}

/* Authentication Modal */
.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.auth-modal-content {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    position: relative;
    animation: slideUp 0.3s ease;
}

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

/* New Navigation Styles */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    padding: 1rem 2rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary-color);
    font-weight: 700;
    font-size: 1.25rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
}

.logo-text {
    background: linear-gradient(135deg, #00B4D8, #0077BE);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.main-nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary-color);
}

.nav-link.active {
    color: #00B4D8;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 2px;
    background: #00B4D8;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.tier-indicator {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--text-secondary-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-btn {
    background: linear-gradient(135deg, #00B4D8, #0077BE);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 180, 216, 0.3);
}

/* Upgrade button - bottom right */
.upgrade-button {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, #FF6B6B, #FF4757);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(255, 75, 87, 0.3);
    transition: all 0.3s ease;
    z-index: 100;
}

.upgrade-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(255, 75, 87, 0.4);
}

/* Adjust main content for fixed header */
body {
    padding-top: 80px;
}

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

.auth-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary-color);
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.auth-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary-color);
}

.auth-modal-content h2 {
    margin-bottom: 1.5rem;
    color: #00B4D8; /* Bright blue matching favicon */
}

.auth-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.auth-tab {
    background: transparent;
    border: none;
    color: var(--text-secondary-color);
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    position: relative;
    transition: all 0.2s ease;
}

.auth-tab:hover {
    color: var(--text-primary-color);
}

.auth-tab.active {
    color: var(--secondary-accent-color);
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--secondary-accent-color);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-form div {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.auth-form label {
    font-weight: 500;
    color: var(--text-primary-color);
    font-size: 0.9rem;
}

.auth-form input {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    color: var(--text-primary-color);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--secondary-accent-color);
    box-shadow: 0 0 0 3px rgba(8, 217, 214, 0.1);
}

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

.auth-submit {
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.auth-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error-color);
    color: var(--error-color);
    padding: 0.75rem;
    border-radius: var(--border-radius);
    text-align: center;
    font-size: 0.9rem;
    margin-top: 1rem;
}

.auth-success {
    animation: slideIn 0.3s ease;
}

.logged-in {
    background: #00B4D8 !important;
    color: white !important;
    /* Removed pointer-events: none to allow logout functionality */
}
/* Layer Compositor Styles */
.layer-compositor-container {
    /* Display controlled by JavaScript - do not set display here */
    flex-direction: column;
    gap: 2rem;
    padding: 2rem;
    background: var(--surface-color);
    border-radius: 12px;
    margin-top: 2rem;
    max-width: 100%;
}

/* When the container is shown, it should be flex */
.layer-compositor-container:not([style*="display: none"]) {
    display: flex;
}

.canvas-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--background-color);
    border-radius: 8px;
    padding: 2rem;
    min-height: 600px;
    position: relative;
}

.layer-compositor-canvas {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    display: block;
    cursor: grab;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    max-width: 100%;
    height: auto;
}

.layer-compositor-canvas:active {
    cursor: grabbing;
}

.text-controls-panel {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.text-controls-panel h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-size: 1.2rem;
}

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

.control-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary-color);
    font-size: 0.9rem;
    font-weight: 500;
}

.control-group input[type="text"],
.control-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--secondary-bg-color);
    color: var(--text-primary-color);
    font-size: 1rem;
}

.control-group input[type="color"] {
    width: 60px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
}

.control-group input[type="range"] {
    width: 100%;
    margin-bottom: 0.25rem;
}

.control-group span {
    display: inline-block;
    color: var(--text-secondary-color);
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

.control-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.control-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.control-actions button {
    flex: 1;
}

@media (max-width: 1200px) {
    .layer-compositor-container {
        gap: 1.5rem;
    }
    
    .text-controls-panel {
        max-width: 600px;
    }
    
    .canvas-container {
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    .layer-compositor-container {
        padding: 1rem;
    }
    
    .canvas-container {
        padding: 1rem;
        min-height: 300px;
    }
    
    .text-controls-panel {
        padding: 1rem;
    }
}

/* Rotate button styles */
.rotate-btn {
    padding: 8px 16px;
    background: #00B4D8;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-right: 10px;
    font-weight: 600;
}

.rotate-btn:hover {
    background: #0099b8;
}

#rotation-value {
    font-weight: bold;
    color: #00B4D8;
    margin-left: 5px;
    font-size: 14px;
}
