/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --text: #2d3748;
    --text-light: #718096;
    --border: #e2e8f0;
    --bg: #f7fafc;
    --white: #ffffff;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-lg: rgba(0, 0, 0, 0.2);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--primary);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-lg);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
    text-align: center;
}

/* Hero Section */
.hero {
    padding: 5rem 0;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.hero-note {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Editor Section */
.editor-section {
    padding: 4rem 0;
}

/* Upload Area */
.upload-area {
    background: var(--white);
    border: 3px dashed var(--border);
    border-radius: 16px;
    padding: 4rem 2rem;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--primary);
    background: #f8f9ff;
}

.upload-area.dragover {
    border-color: var(--primary);
    background: #f8f9ff;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.upload-content h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.upload-content p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.upload-note {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 1rem;
}

/* Editor Interface */
.editor-interface {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

/* Controls Panel */
.controls-panel {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow);
    height: fit-content;
}

.control-group {
    margin-bottom: 2rem;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
}

/* Frame Selector */
.frame-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.frame-btn {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.frame-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.frame-btn.active {
    border-color: var(--primary);
    background: #f8f9ff;
}

.frame-preview {
    width: 60px;
    height: 40px;
    background: var(--border);
    border-radius: 4px;
    position: relative;
}

.frame-preview.no-frame {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e0 100%);
}

.frame-preview.macbook-preview {
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: 6px 6px 0 0;
}

.frame-preview.iphone-preview {
    width: 30px;
    height: 50px;
    background: #1a1a1a;
    border: 3px solid #333;
    border-radius: 12px;
}

.frame-preview.ipad-preview {
    width: 45px;
    height: 55px;
    background: #1a1a1a;
    border: 3px solid #333;
    border-radius: 8px;
}

.frame-btn span {
    font-size: 0.85rem;
    font-weight: 600;
}

.pro-feature {
    opacity: 0.6;
    position: relative;
}

.pro-feature::after {
    content: 'PRO';
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--primary);
    color: white;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

/* Background Selector */
.background-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.bg-btn {
    height: 60px;
    border: 3px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.bg-btn span {
    position: absolute;
    bottom: 8px;
    left: 8px;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.bg-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-lg);
}

.bg-btn.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* Effects Controls */
.effects-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.control-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 500;
}

.control-label input[type="range"] {
    width: 60%;
    cursor: pointer;
}

.control-label input[type="text"] {
    width: 60%;
    padding: 0.5rem;
    border: 2px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
}

.control-label input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
}

.control-label input[type="color"] {
    width: 60px;
    height: 40px;
    border: 2px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
}

.control-label select {
    width: 60%;
    padding: 0.5rem;
    border: 2px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    background: white;
}

.control-label select:focus {
    outline: none;
    border-color: var(--primary);
}

.checkbox-label {
    justify-content: flex-start;
    gap: 0.5rem;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

/* Emoji Selector */
.emoji-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.emoji-btn {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.5rem;
    text-align: center;
}

.emoji-btn:hover {
    border-color: var(--primary);
    transform: scale(1.1);
}

.emoji-btn.active {
    border-color: var(--primary);
    background: #f8f9ff;
}

/* Text Controls */
.text-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.position-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Export Controls */
.export-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Canvas Container */
.canvas-container {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.canvas-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px;
    background: #f7fafc;
    border-radius: 8px;
    overflow: auto;
}

#canvas {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow);
}

.canvas-info {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Features Section */
.features-section {
    padding: 5rem 0;
    background: var(--white);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--text);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2rem;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.feature-card p {
    color: var(--text-light);
}

/* Pricing Section */
.pricing-section {
    padding: 5rem 0;
    background: var(--bg);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.pricing-card {
    background: var(--white);
    padding: 2.5rem 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow);
    position: relative;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow-lg);
}

.pricing-card-featured {
    border-color: var(--primary);
    transform: scale(1.05);
}

.pricing-card-featured:hover {
    transform: scale(1.08);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.pricing-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.pricing-price {
    margin-bottom: 2rem;
}

.price {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
}

.period {
    color: var(--text-light);
    font-size: 1rem;
}

.pricing-features {
    list-style: none;
    margin-bottom: 2rem;
}

.pricing-features li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

.pricing-features li:last-child {
    border-bottom: none;
}

/* Footer */
.footer {
    background: var(--text);
    color: var(--white);
    padding: 2rem 0;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
}

.footer-links a {
    color: var(--white);
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.footer-links a:hover {
    opacity: 1;
}

/* Mobile Touch Improvements */
.frame-btn,
.bg-btn,
.emoji-btn,
.btn {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Smooth scrolling for mobile */
html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Better touch targets for mobile */
input[type="range"] {
    height: 44px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--primary);
    cursor: pointer;
    border-radius: 50%;
}

input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: var(--primary);
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

/* Responsive */
@media (max-width: 968px) {
    .editor-interface {
        grid-template-columns: 1fr;
    }
    
    .controls-panel {
        order: 2;
        margin-top: 1rem;
    }
    
    .canvas-container {
        order: 1;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .nav {
        gap: 1rem;
    }

    .pricing-card-featured {
        transform: scale(1);
    }
    
    /* Make controls more touch-friendly */
    .frame-btn,
    .bg-btn,
    .emoji-btn {
        padding: 1.25rem;
        min-height: 60px;
    }
    
    .control-label {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .control-label input[type="range"],
    .control-label input[type="text"],
    .control-label select {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .nav-link {
        display: none;
    }

    .frame-selector,
    .background-selector {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    .emoji-selector {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.5rem;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .controls-panel {
        padding: 1.5rem;
    }
    
    .canvas-container {
        padding: 1rem;
    }
    
    /* Stack buttons vertically on small screens */
    .hero-cta {
        flex-direction: column;
        align-items: center;
    }
}

/* Install prompt styling */
.install-prompt {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: none;
    z-index: 1000;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.install-prompt.show {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.install-prompt button {
    background: white;
    color: var(--primary);
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
}
