/* Consolidated CSS for PWA Creation Page - Fix for Production */

/* Main Layout */
.create-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
}

.main-content {
    min-width: 0;
}

.preview-panel {
    position: sticky;
    top: 2rem;
    height: fit-content;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

/* Headers */
.create-header {
    margin-bottom: 2rem;
}

.create-header h1 {
    font-size: 2rem;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.create-header p {
    color: #666;
    font-size: 1rem;
}

/* Form Sections */
.form-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.form-section.collapsible {
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    margin-bottom: 1rem;
}

.section-content {
    transition: all 0.3s ease;
}

.section-content.collapsed {
    max-height: 0;
    margin-bottom: 0;
    opacity: 0;
    overflow: hidden;
}

.form-section h2 {
    font-size: 1.25rem;
    color: #1a1a1a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.collapse-icon {
    transition: transform 0.3s ease;
    opacity: 0.6;
}

.collapse-icon.rotated {
    transform: rotate(180deg);
}

/* Form Elements */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

/* Layout para campos na mesma linha */
.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-row .form-group {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-row .form-group {
        margin-bottom: 1.5rem;
    }
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #4a4a4a;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* Color Input */
.color-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-input {
    flex: 1;
}

.color-preview {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    cursor: pointer;
}

/* Layout Options */
.layout-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.layout-option {
    position: relative;
}

.layout-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.layout-card {
    display: block;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.layout-card:hover {
    border-color: #8b5cf6;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.15);
}

.layout-option input[type="radio"]:checked + .layout-card {
    border-color: #8b5cf6;
    background: #f8f4ff;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.2);
}

/* Layout Preview */
.layout-preview {
    width: 100%;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0.75rem;
    position: relative;
}

.layout-preview.original {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.layout-preview.netflix {
    background: linear-gradient(135deg, #141414 0%, #2a2a2a 100%);
}

.preview-header {
    height: 15px;
    background: rgba(255, 255, 255, 0.2);
    margin: 8px;
    border-radius: 4px;
}

.preview-content {
    padding: 0 8px;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.preview-card {
    height: 25px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.preview-row {
    margin-bottom: 6px;
}

.preview-banner {
    height: 20px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    margin-bottom: 4px;
}

.preview-row:last-child {
    display: flex;
    gap: 4px;
}

.preview-item {
    flex: 1;
    height: 18px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.layout-info h4 {
    margin: 0 0 0.25rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
}

.layout-info p {
    margin: 0;
    font-size: 0.75rem;
    color: #666;
    line-height: 1.3;
}

/* Preview Section */
.preview-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.preview-section h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Mobile Preview Device */
.preview-device {
    width: 320px;
    height: 640px;
    margin: 0 auto;
    background: #1a1a1a;
    border-radius: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    padding: 25px 15px;
    position: relative;
    overflow: hidden;
}

.preview-device::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 6px;
    background: #333;
    border-radius: 3px;
}

.preview-screen {
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 25px;
    overflow: hidden;
    position: relative;
}

/* Preview Login Screen */
.preview-login-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: #1a1a2e;
    color: white;
}

.preview-login-screen.active {
    display: flex;
}

.preview-login-screen.hidden {
    display: none;
}

.preview-logo {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.preview-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-align: center;
}

.preview-subtitle {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 2rem;
    text-align: center;
}

.preview-input {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 0.9rem;
}

.preview-input::placeholder {
    color: rgba(255,255,255,0.6);
}

.preview-button {
    width: 100%;
    padding: 0.75rem;
    background: #8b5cf6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 1rem;
}

.preview-forgot-link {
    color: #8b5cf6;
    font-size: 0.8rem;
    text-decoration: none;
}

/* Preview Home Screen */
.preview-home-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    flex-direction: column;
    background: white;
}

.preview-home-screen.active {
    display: flex;
}

.preview-home-header {
    padding: 1rem;
    background: #8b5cf6;
    color: white;
    text-align: center;
}

.preview-home-content {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

/* Netflix Layout Styles */
.netflix-section {
    margin-bottom: 1.5rem;
}

.netflix-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #333;
}

.netflix-modules-scroll {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.netflix-module-card {
    min-width: 120px;
    height: 80px;
    background: #f1f5f9;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.netflix-module-card:hover {
    transform: scale(1.05);
}

.netflix-module-card.netflix-placeholder {
    border: 2px dashed #cbd5e1;
    background: #f8fafc;
}

.netflix-module-image {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.netflix-module-name {
    font-size: 0.7rem;
    text-align: center;
    font-weight: 500;
    color: #64748b;
}

/* Original Layout Styles */
.preview-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
}

.preview-product-card {
    background: #f8fafc;
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.preview-product-card:hover {
    transform: translateY(-2px);
}

.preview-product-image {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.preview-product-name {
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: #334155;
}

.preview-product-stats {
    font-size: 0.7rem;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

/* No Content State */
.preview-no-content {
    text-align: center;
    padding: 2rem;
    color: #64748b;
}

.preview-no-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.preview-no-content p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: #8b5cf6;
    color: white;
}

.btn-primary:hover {
    background: #7c3aed;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: #8b5cf6;
    border: 1px solid #8b5cf6;
}

.btn-outline:hover {
    background: #8b5cf6;
    color: white;
}

/* Responsive */
@media (max-width: 1200px) {
    .create-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .preview-panel {
        position: static;
        max-height: none;
    }
    
    .preview-device {
        width: 280px;
        height: 560px;
    }
}

@media (max-width: 768px) {
    .create-container {
        padding: 1rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .layout-options {
        grid-template-columns: 1fr;
    }
}