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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    min-height: 100vh;
}

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

/* Header */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.5rem;
    color: #2d3748;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

header p {
    color: #718096;
    font-size: 1.1rem;
}

/* Ad spaces */
.ad-space {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    margin: 20px 0;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #cbd5e0;
}

.ad-placeholder {
    color: #a0aec0;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.side-ad {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    height: 600px;
    z-index: 100;
}

@media (max-width: 1400px) {
    .side-ad {
        display: none;
    }
}

/* Main content */
main {
    padding: 2rem 0;
}

/* Upload section */
.upload-section {
    margin-bottom: 2rem;
}

.upload-area {
    background: rgba(255, 255, 255, 0.95);
    border: 3px dashed #cbd5e0;
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
}

.upload-area:hover {
    border-color: #4facfe;
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.15);
}

.upload-area.dragover {
    border-color: #4facfe;
    background: rgba(79, 172, 254, 0.05);
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: #4facfe;
    margin-bottom: 1rem;
    pointer-events: none;
}

.upload-content {
    pointer-events: none;
}

.upload-content h3 {
    color: #2d3748;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.upload-content p {
    color: #718096;
}

/* Editor section */
.editor-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.controls {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tool-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #4facfe;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tool-btn:hover {
    background: #3b9ae1;
    transform: translateY(-1px);
}

.tool-btn:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
}

.tool-btn svg {
    width: 18px;
    height: 18px;
}

.tool-btn.active {
    background: #48bb78;
}

.selection-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f0f8ff;
    border: 1px solid #4facfe;
    border-radius: 8px;
    font-size: 0.9rem;
}

.selection-info span {
    color: #2d3748;
    font-weight: 500;
}

.clear-btn {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-btn:hover {
    background: #c53030;
}

/* Selection overlay */
.canvas-container {
    position: relative;
}

.selection-overlay {
    position: absolute;
    border: 2px dashed #4facfe;
    background: rgba(79, 172, 254, 0.1);
    pointer-events: none;
    z-index: 10;
}

.selected-color {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.color-preview {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

#colorValue {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #4a5568;
}

label {
    font-weight: 500;
    color: #4a5568;
}

#threshold {
    width: 120px;
}

#thresholdValue {
    font-weight: 500;
    color: #4a5568;
    min-width: 30px;
}



/* Canvas container */
.canvas-container {
    text-align: center;
    margin-bottom: 2rem;
}

#canvas, #resultCanvas {
    max-width: 100%;
    max-height: 500px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    cursor: default;
}

#canvas.eyedropper-active {
    cursor: crosshair;
}

#resultCanvas {
    cursor: default !important;
}

#canvas.selection-active {
    cursor: crosshair;
}

/* Result section */
.result-section {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

.result-section h3 {
    color: #2d3748;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.result-controls {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.download-btn {
    background: #4facfe;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.download-btn:hover {
    background: #3b9ae1;
    transform: translateY(-1px);
}

.reset-btn {
    background: #e2e8f0;
    color: #4a5568;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.reset-btn:hover {
    background: #cbd5e0;
    transform: translateY(-1px);
}

/* SEO Content Section */
.seo-content {
    background: rgba(255, 255, 255, 0.95);
    margin: 2rem 0;
    padding: 3rem 0;
    backdrop-filter: blur(10px);
}

.seo-content h2 {
    color: #2d3748;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.seo-content h3 {
    color: #4a5568;
    margin: 2rem 0 1rem 0;
    font-size: 1.5rem;
}

.seo-content h4 {
    color: #2d3748;
    margin: 1.5rem 0 0.5rem 0;
    font-size: 1.2rem;
}

.seo-content ul {
    margin: 1rem 0;
    padding-left: 2rem;
}

.seo-content li {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.seo-content strong {
    color: #2d3748;
}

.faq-section {
    margin-top: 2rem;
}

.faq-item {
    background: rgba(247, 250, 252, 0.8);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: box-shadow 0.3s ease;
}

.faq-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.faq-item h4 {
    margin-top: 0;
    color: #2d3748;
    font-weight: 600;
}

.faq-item p {
    margin-bottom: 0;
    color: #4a5568;
    line-height: 1.6;
}

/* Footer */
footer {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem 0;
    text-align: center;
    color: #718096;
    backdrop-filter: blur(10px);
    margin-top: 0;
}

footer p {
    margin-bottom: 0.5rem;
}

footer a {
    text-decoration: none;
    color: inherit;
}

footer a:hover {
    text-decoration: underline;
}

/* Privacy Policy Page */
.privacy-policy {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 3rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.privacy-policy h2 {
    color: #2d3748;
    font-size: 2rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #4facfe;
    padding-bottom: 0.5rem;
}

.privacy-policy h3 {
    color: #2d3748;
    font-size: 1.4rem;
    margin: 2rem 0 1rem 0;
    font-weight: 600;
}

.privacy-policy h4 {
    color: #4a5568;
    font-size: 1.1rem;
    margin: 1.5rem 0 0.5rem 0;
    font-weight: 600;
}

.privacy-policy p {
    color: #4a5568;
    margin-bottom: 1rem;
}

.privacy-policy ul {
    color: #4a5568;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.privacy-policy li {
    margin-bottom: 0.5rem;
}

.privacy-policy a {
    color: #4facfe;
    text-decoration: none;
}

.privacy-policy a:hover {
    text-decoration: underline;
}

/* Override for back button specifically */
.privacy-policy .back-to-home .back-link {
    color: white !important;
    background: #4facfe !important;
}

.privacy-policy .back-to-home .back-link:hover {
    color: white !important;
    background: #3b9ae1 !important;
    text-decoration: none !important;
}

.privacy-policy strong {
    color: #2d3748;
    font-weight: 600;
}

.back-to-home {
    margin-top: 3rem;
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

.back-to-home .back-link {
    display: inline-block;
    background: #4facfe;
    color: white !important;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    text-decoration: none !important;
    font-weight: 600;
    transition: all 0.3s ease;
}

.back-to-home .back-link:hover {
    background: #3b9ae1;
    color: white !important;
    transform: translateY(-1px);
    text-decoration: none !important;
}

/* Comprehensive Content Section */
.comprehensive-content {
    background: rgba(255, 255, 255, 0.98);
    margin: 2rem 0 0 0;
    padding: 2rem 0;
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.content-toggle {
    cursor: pointer;
    user-select: none;
    padding: 1rem 0;
    border-bottom: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.content-toggle:hover {
    background: rgba(74, 85, 104, 0.05);
    border-radius: 8px;
    padding: 1rem;
}

.content-toggle h2 {
    color: #2d3748;
    margin: 0;
    font-size: 1.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toggle-icon {
    font-size: 1.5rem;
    font-weight: bold;
    color: #4a5568;
    transition: transform 0.3s ease;
}

.comprehensive-content.expanded .toggle-icon {
    transform: rotate(45deg);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
}

.comprehensive-content.expanded .collapsible-content {
    max-height: 10000px;
}

.content-section {
    padding: 2rem 0;
}

.content-section h3 {
    color: #2d3748;
    margin: 2rem 0 1rem 0;
    font-size: 1.5rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.content-section h4 {
    color: #4a5568;
    margin: 1.5rem 0 0.5rem 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.content-section p {
    color: #4a5568;
    line-height: 1.7;
    margin-bottom: 1rem;
    text-align: justify;
}

.content-section strong {
    color: #2d3748;
    font-weight: 600;
}

/* Responsive adjustments for content */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    header h1 {
        font-size: 2rem;
    }

    .upload-area {
        padding: 2rem 1rem;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .control-group {
        justify-content: space-between;
    }

    .result-controls {
        flex-direction: column;
        align-items: center;
    }

    .side-ad {
        display: none;
    }

    .content-toggle h2 {
        font-size: 1.5rem;
    }
    
    .content-section {
        padding: 1rem 0;
    }
    
    .content-section p {
        text-align: left;
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4facfe;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

/* Social Sharing Section */
.social-sharing {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 3rem 0;
    margin: 2rem 0;
    text-align: center;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.sharing-content h3 {
    color: #2d3748;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.sharing-subtitle {
    color: #718096;
    margin-bottom: 2rem;
    font-size: 1rem;
}

.share-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.share-btn svg {
    width: 18px;
    height: 18px;
}

.twitter-btn {
    background: #1da1f2;
}

.twitter-btn:hover {
    background: #1991db;
}

.facebook-btn {
    background: #4267b2;
}

.facebook-btn:hover {
    background: #365899;
}

.linkedin-btn {
    background: #0077b5;
}

.linkedin-btn:hover {
    background: #005885;
}

.copy-btn {
    background: #48bb78;
}

.copy-btn:hover {
    background: #38a169;
}

.copy-btn.copied {
    background: #38a169;
}

.copy-btn.copied::after {
    content: " ✓";
}

/* Mobile responsiveness for sharing buttons */
@media (max-width: 768px) {
    .share-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .share-btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
    
    .sharing-content h3 {
        font-size: 1.3rem;
    }
} 