/* ========================================
   Flip Image Tool - Modern Premium Styles
   ======================================== */

:root {
    --primary-color: #2c8462;
    --primary-dark: #1f5e45;
    --primary-light: #3da876;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;

    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --bg-dark: #212529;

    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-light: #ffffff;

    --border-color: #dee2e6;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 12px 40px rgba(0, 0, 0, 0.15);

    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ========================================
   Tool Container
   ======================================== */

.tool-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ========================================
   Tool Header - WHITE BACKGROUND NO BORDER
   ======================================== */

.tool-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 1rem;
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    color: var(--text-primary);

}

.tool-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
}

.tool-icon i {
    font-size: 2.5rem;
    color: var(--text-light);
}

.tool-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    color: var(--text-primary);
}

.tool-description {
    font-size: 1.1rem;
    margin: 0;
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ========================================
   Flip Tool Wrapper
   ======================================== */

.flip-tool-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* ========================================
   Section Card
   ======================================== */

.section-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    padding: 2rem;

    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

.section-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.section-card.hidden {
    display: none;
}

/* ========================================
   Upload Section
   ======================================== */

.upload-area {
    border: 3px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 3rem 2rem;
    text-align: center;
    background: var(--bg-secondary);
    transition: all var(--transition-normal);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(44, 132, 98, 0.05) 0%, rgba(31, 94, 69, 0.05) 100%);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.upload-area:hover::before {
    opacity: 1;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: var(--bg-primary);
    transform: scale(1.01);
}

.upload-area.drag-over {
    border-color: var(--primary-color);
    background: rgba(44, 132, 98, 0.1);
    transform: scale(1.02);
}

.upload-content {
    position: relative;
    z-index: 1;
}

.upload-icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: block;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.upload-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.upload-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0 0 1.5rem 0;
}

.upload-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 1rem 0 0 0;
}

/* ========================================
   Buttons
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::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 var(--transition-normal), height var(--transition-normal);
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn i {
    position: relative;
    z-index: 1;
}

.btn span {
    position: relative;
    z-index: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--text-light);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--text-light);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ========================================
   Preview Container
   ======================================== */

.preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.image-preview-box {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    transition: all var(--transition-normal);
}

.image-preview-box:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.preview-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.preview-label i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.image-wrapper {
    background: var(--bg-primary);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.image-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
        linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    opacity: 0.3;
    z-index: 0;
}

.image-wrapper canvas {
    max-width: 100%;
    max-height: 400px;
    height: auto;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-sm);
    position: relative;
    z-index: 1;
    object-fit: contain;
}

.image-info {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--bg-primary);
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    border: 1px solid var(--border-color);
}

/* ========================================
   Controls Section
   ======================================== */

.controls-section {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 2rem;
    border: 2px solid var(--border-color);
}

.controls-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 1.5rem 0;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.controls-title i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.control-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem 1rem;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}

.control-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(44, 132, 98, 0.1), transparent);
    transition: left var(--transition-slow);
}

.control-btn:hover::before {
    left: 100%;
}

.control-btn i {
    font-size: 2rem;
    color: var(--primary-color);
    transition: all var(--transition-normal);
}

.control-btn:hover {
    border-color: var(--primary-color);
    background: rgba(44, 132, 98, 0.05);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.control-btn:hover i {
    transform: scale(1.1);
}

.control-btn:active {
    transform: translateY(-1px);
}

.control-btn.reset-btn {
    border-color: var(--warning-color);
}

.control-btn.reset-btn i {
    color: var(--warning-color);
}

.control-btn.reset-btn:hover {
    border-color: var(--warning-color);
    background: rgba(255, 193, 7, 0.1);
}

.control-btn.download-btn {
    border-color: var(--success-color);
}

.control-btn.download-btn i {
    color: var(--success-color);
}

.control-btn.download-btn:hover {
    border-color: var(--success-color);
    background: rgba(40, 167, 69, 0.1);
}

/* ========================================
   Download Options
   ======================================== */

.download-options {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-primary);
    border-radius: var(--border-radius-sm);
    border: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.format-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.format-label i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.format-buttons {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-secondary);
    padding: 0.25rem;
    border-radius: var(--border-radius-sm);
}

.format-btn {
    padding: 0.5rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.format-btn:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.format-btn.active {
    background: var(--primary-color);
    color: var(--text-light);
    box-shadow: var(--shadow-sm);
}

/* ========================================
   New Upload Section
   ======================================== */

.new-upload-section {
    text-align: center;
    padding-top: 1rem;
    border-top: 2px solid var(--border-color);
}

/* ========================================
   Loading Indicator
   ======================================== */

.loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loading-indicator.hidden {
    display: none;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-indicator p {
    color: var(--text-light);
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1.5rem;
}

/* ========================================
   Notification
   ======================================== */

.notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 10000;
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

.notification.hidden {
    display: none;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    border-left: 4px solid var(--primary-color);
}

.notification.success .notification-content {
    border-left-color: var(--success-color);
}

.notification.error .notification-content {
    border-left-color: var(--danger-color);
}

.notification.warning .notification-content {
    border-left-color: var(--warning-color);
}

.notification-icon {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-icon i {
    color: var(--primary-color);
}

.notification.success .notification-icon i {
    color: var(--success-color);
}

.notification.error .notification-icon i {
    color: var(--danger-color);
}

.notification.warning .notification-icon i {
    color: var(--warning-color);
}

.notification-message {
    flex: 1;
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-close:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

/* ========================================
   SEO Content
   ======================================== */

.seo-content {
    max-width: 1200px;
    margin: 4rem auto 2rem;
    padding: 0 1rem;
}

.seo-section {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    padding: 3rem;


}

.seo-section h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 1.5rem 0;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--primary-color);
}

.seo-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 2rem 0 1rem 0;
}

.seo-section h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 1.5rem 0 0.75rem 0;
}

.seo-section p {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin: 0 0 1rem 0;
}

.seo-section ul,
.seo-section ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.seo-section li {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin: 0.5rem 0;
}

.seo-section li strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    .tool-container {
        padding: 1rem 0.5rem;
    }

    .tool-header {
        margin-bottom: 2rem;
        padding: 1.5rem 1rem;
    }

    .tool-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 1rem;
    }

    .tool-icon i {
        font-size: 2rem;
    }

    .tool-title {
        font-size: 1.8rem;
    }

    .tool-description {
        font-size: 1rem;
    }

    .section-card {
        padding: 1.5rem;
    }

    .upload-area {
        padding: 2rem 1rem;
    }

    .upload-icon {
        font-size: 3rem;
    }

    .upload-content h3 {
        font-size: 1.2rem;
    }

    .preview-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .controls-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .control-btn {
        padding: 1rem 0.5rem;
        font-size: 0.8rem;
    }

    .control-btn i {
        font-size: 1.5rem;
    }

    .download-options {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .format-buttons {
        justify-content: center;
    }

    .notification {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }

    .seo-section {
        padding: 2rem 1.5rem;
    }

    .seo-section h2 {
        font-size: 1.5rem;
    }

    .seo-section h3 {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .tool-title {
        font-size: 1.5rem;
    }

    .controls-grid {
        grid-template-columns: 1fr;
    }

    .control-btn {
        flex-direction: row;
        justify-content: flex-start;
        padding: 1rem;
    }

    .control-btn i {
        font-size: 1.3rem;
    }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {

    .tool-header,
    .controls-section,
    .notification,
    .loading-indicator {
        display: none;
    }

    .section-card {
        box-shadow: none;
        border: 1px solid #000;
    }
}