/* Global Styles */
:root {
    --primary: #321fdb;
    --secondary: #9da5b1;
    --success: #2eb85c;
    --info: #39f;
    --warning: #f9b115;
    --danger: #e55353;
    --light: #ebedef;
    --dark: #4d5b69;
    --primary-rgb: 50, 31, 219;
    --secondary-rgb: 157, 165, 177;
    --success-rgb: 46, 184, 92;
    --info-rgb: 51, 153, 255;
    --warning-rgb: 249, 177, 21;
    --danger-rgb: 229, 83, 83;
    --light-rgb: 235, 237, 239;
    --dark-rgb: 77, 91, 105;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    color: #333;
    line-height: 1.6;
}

/* Body adjustments for fixed header */
.c-body {
    padding-top: 80px;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../img/pattern.png') center/cover;
    opacity: 0.1;
    z-index: 0;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

/* Icon Box */
.icon-box {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    transition: all 0.3s ease;
}

/* Drop Area */
#drop-area {
    border: 2px dashed #d1d9df;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

#drop-area:hover, #drop-area.dragover {
    border-color: var(--primary);
    background-color: rgba(var(--primary-rgb), 0.05);
}

/* File List */
.file-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.file-item .file-info {
    flex: 1;
    margin-left: 1rem;
}

.file-item .file-actions {
    margin-left: auto;
}

/* Footer */
.c-footer {
    background-color: #f0f3f5;
    padding: 3rem 0;
    color: #4d5b69;
}

.c-footer h5 {
    color: #2c3a4a;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.c-footer ul li {
    margin-bottom: 0.75rem;
}

.c-footer a {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.2s ease;
}

.c-footer a:hover {
    color: var(--primary);
    text-decoration: none;
}

/* Responsive Adjustments */
@media (max-width: 991.98px) {
    .c-sidebar {
        margin-left: -250px;
    }
    
    .c-sidebar.show {
        margin-left: 0;
    }
    
    .c-header-toggler {
        display: block;
    }
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

/* Resize options styling */
.resize-option {
    transition: all 0.3s ease;
}

.resize-option.d-none {
    opacity: 0;
    transform: translateY(-10px);
}

.resize-option:not(.d-none) {
    opacity: 1;
    transform: translateY(0);
}

/* Custom form controls */
.form-control-sm {
    font-size: 0.875rem;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* Modern Header Styles */
.modern-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

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

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--dark-text);
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-color);
    transform: scale(1.05);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.header-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.2);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    line-height: 1.2;
}

.brand-tagline {
    font-size: 0.75rem;
    color: var(--muted-text);
    margin: 0;
    opacity: 0.8;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.header-nav .nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    color: var(--dark-text);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.header-nav .nav-link i {
    font-size: 1rem;
    transition: all 0.3s ease;
}

.header-nav .nav-link:hover {
    color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.08);
    transform: translateY(-2px);
}

.header-nav .nav-link:hover i {
    transform: scale(1.1);
}

.header-nav .nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.header-nav .nav-link:hover::before {
    width: 80%;
}

.header-actions {
    display: flex;
    align-items: center;
}

.btn-convert {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.3);
    transition: all 0.3s ease;
    overflow: hidden;
}

.btn-convert:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(var(--primary-rgb), 0.4);
    color: white;
    text-decoration: none;
}

.btn-convert i {
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-convert:hover i {
    transform: rotate(180deg);
}

.btn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: all 0.6s ease;
}

.btn-convert:hover .btn-glow {
    left: 100%;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .header-container {
        padding: 0.5rem 1rem;
    }
    
    .modern-header {
        background: rgba(255, 255, 255, 0.98);
    }
}

@media (max-width: 767.98px) {
    .btn-convert span {
        display: none;
    }
    
    .btn-convert {
        padding: 0.75rem;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        justify-content: center;
    }
}

/* Utility classes */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.shadow {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Accordion */
.accordion .card {
    margin-bottom: 1rem;
    border: none;
    border-radius: 8px !important;
    overflow: hidden;
}

.accordion .card-header {
    background-color: #fff;
    padding: 0;
    border: none;
}

.accordion .btn-link {
    display: block;
    width: 100%;
    padding: 1.25rem 1.5rem;
    text-align: left;
    text-decoration: none;
    color: #2c3a4a;
    position: relative;
    transition: all 0.3s ease;
}

.accordion .btn-link:hover {
    text-decoration: none;
    color: var(--primary);
}

.accordion .btn-link i {
    transition: transform 0.3s ease;
}

.accordion .btn-link[aria-expanded="true"] i {
    transform: rotate(180deg);
}

/* Form Controls */
.form-control {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border: 1px solid #d8dbe0;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.25);
}

/* Buttons */
.btn {
    padding: 0.625rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: #2819b8;
    border-color: #2417a9;
}

.btn-outline-light:hover {
    color: var(--primary);
    background-color: #fff;
}

/* Social Icons */
.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #e9ecef;
    color: #4d5b69;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background-color: var(--primary);
    color: #fff;
    transform: translateY(-3px);
}

/* Canvas Editor Styles */
.canvas-container {
    position: relative;
    overflow: auto;
    max-height: 600px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.main-canvas {
    border: 1px solid #dee2e6;
    background: white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    cursor: crosshair;
    max-width: 100%;
    max-height: 100%;
}

.canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 10;
}

.image-library {
    max-height: 200px;
    overflow-y: auto;
}

.library-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 0.25rem;
    cursor: grab;
    margin: 0.25rem;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.library-image:hover {
    border-color: #007bff;
    transform: scale(1.05);
}

.library-image:active {
    cursor: grabbing;
}

.layers-list {
    max-height: 150px;
    overflow-y: auto;
}

.layer-item {
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    margin-bottom: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.layer-item:hover {
    background-color: #f8f9fa;
}

.layer-item.active {
    background-color: #e3f2fd;
    border-color: #2196f3;
}

.layer-preview {
    width: 30px;
    height: 30px;
    object-fit: cover;
    border-radius: 0.25rem;
    margin-right: 0.5rem;
}

.layer-controls {
    margin-left: auto;
}

.layer-controls button {
    padding: 0.125rem 0.25rem;
    font-size: 0.75rem;
}

.object-properties .form-group {
    margin-bottom: 1rem;
}

.object-properties input[type="range"] {
    width: 100%;
}

.canvas-tools {
    display: flex;
    align-items: center;
}

.selection-box {
    position: absolute;
    border: 2px dashed #007bff;
    background: rgba(0, 123, 255, 0.1);
    pointer-events: none;
    z-index: 20;
}

.resize-handle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #007bff;
    border: 1px solid white;
    border-radius: 50%;
    cursor: pointer;
    z-index: 30;
}

.resize-handle.nw { top: -4px; left: -4px; cursor: nw-resize; }
.resize-handle.ne { top: -4px; right: -4px; cursor: ne-resize; }
.resize-handle.sw { bottom: -4px; left: -4px; cursor: sw-resize; }
.resize-handle.se { bottom: -4px; right: -4px; cursor: se-resize; }
.resize-handle.n { top: -4px; left: 50%; margin-left: -4px; cursor: n-resize; }
.resize-handle.s { bottom: -4px; left: 50%; margin-left: -4px; cursor: s-resize; }
.resize-handle.w { top: 50%; left: -4px; margin-top: -4px; cursor: w-resize; }
.resize-handle.e { top: 50%; right: -4px; margin-top: -4px; cursor: e-resize; }

.rotate-handle {
    position: absolute;
    top: -20px;
    left: 50%;
    margin-left: -4px;
    width: 8px;
    height: 8px;
    background: #28a745;
    border: 1px solid white;
    border-radius: 50%;
    cursor: pointer;
    z-index: 30;
}

.rotate-handle::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    margin-left: -1px;
    width: 2px;
    height: 12px;
    background: #28a745;
}

/* Canvas Editor Responsive */
@media (max-width: 991.98px) {
    .canvas-container {
        max-height: 400px;
        min-height: 300px;
    }
    
    .library-image {
        width: 50px;
        height: 50px;
    }
    
    .layer-preview {
        width: 25px;
        height: 25px;
    }
}

@media (max-width: 767.98px) {
    .canvas-container {
        max-height: 300px;
        min-height: 250px;
    }
    
    .canvas-tools {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
}
