/* Logo Maker Styles */
:root {
    --primary-color: #6dc179;
    --primary-gradient: linear-gradient(135deg, #6dc179 0%, #5ec2d0 100%);
    --secondary-color: #5ec2d0;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
    --border-color: #dee2e6;
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Nunito Sans", Arial, sans-serif;
    background: #f8f9fa;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

html, body {
    height: 100%;
}

/* Header Styles */
.navbar {
    background: var(--primary-gradient) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    padding: 5px 10px;
}

.navbar-brand img {
    filter: brightness(0) invert(1);
}

/* Layout */
.container-fluid {
    padding: 0;
    height: calc(100vh - 76px);
}

.row.h-100 {
    margin: 0;
    height: 100%;
}

/* Sidebar Styles */
.logo-controls-sidebar {
    background: #fff;
    border-right: 1px solid var(--border-color);
    height: 100%;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
}

.control-section {
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
}

.control-section:last-child {
    border-bottom: none;
}

.control-section h5 {
    color: var(--dark-color);
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1rem;
}



/* Form Controls */
.form-control, .form-select {
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-size: 14px;
}

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

.form-range::-webkit-slider-thumb {
    background: var(--primary-color);
}

.form-range::-moz-range-thumb {
    background: var(--primary-color);
    border: none;
}

.form-control-color {
    width: 100%;
    height: 38px;
    border-radius: 6px;
}





}

/* Icon Grid */


/* Free Banner */
.free-banner {
    animation: gentle-pulse 4s infinite;
    transition: all 0.3s ease;
}

.free-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(109, 193, 121, 0.3);
}

@keyframes gentle-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.9; }
}

/* Enhanced Icon Grid */
.icon-grid .icon-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

/* Loading States */
.icon-grid .loading-item {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    color: #6c757d;
    font-size: 12px;
    grid-column: 1 / -1;
    min-height: 60px;
}

/* Search Enhancement */
.input-group .btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.input-group .btn-outline-primary:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Canvas Area */
.canvas-area {
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0;
}

.canvas-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.canvas-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.canvas-zoom {
    display: flex;
    align-items: center;
    gap: 10px;
}

#zoomLevel {
    font-weight: 600;
    min-width: 50px;
    text-align: center;
}

#canvasWrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 25px rgba(0,0,0,0.1);
    padding: 40px;
    position: relative;
}

#logoCanvas {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    max-width: 100%;
    max-height: 100%;
}

.canvas-info {
    text-align: center;
    margin-top: 15px;
}

/* Buttons */
.btn-primary {
    background: var(--primary-gradient);
    border: none;
    border-radius: 6px;
    font-weight: 600;
    padding: 8px 16px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(109, 193, 121, 0.4);
}

.btn-outline-secondary {
    border-color: var(--border-color);
    color: var(--dark-color);
    border-radius: 6px;
}

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

.btn-outline-light {
    border-color: rgba(255,255,255,0.3);
}

.btn-outline-light:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
}

/* Modal Styles */
.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
    background: var(--primary-gradient);
    color: white;
    border-radius: 15px 15px 0 0;
    border-bottom: none;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.card {
    border: 2px solid var(--border-color);
    border-radius: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.card:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(109, 193, 121, 0.2);
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .logo-controls-sidebar {
        position: fixed;
        top: 76px;
        left: -100%;
        width: 320px;
        max-width: 90vw;
        z-index: 1050;
        transition: left 0.3s ease;
        height: calc(100vh - 76px);
        box-shadow: 2px 0 20px rgba(0,0,0,0.15);
        overflow-y: auto;
    }
    
    .logo-controls-sidebar.show {
        left: 0;
    }
    
    .canvas-area {
        width: 100%;
        padding-left: 0;
    }
    
    .canvas-container {
        padding: 10px;
    }
    
    #canvasWrapper {
        padding: 20px;
    }
    
    .canvas-toolbar {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    .btn-group {
        flex-wrap: wrap;
    }
    
    /* Mobile overlay when sidebar is open */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 1040;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
}

@media (max-width: 767.98px) {
    .template-grid {
        grid-template-columns: 1fr;
    }
    
    .icon-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    #canvasWrapper {
        padding: 10px;
    }
    
    #logoCanvas {
        max-width: 100%;
        height: auto;
    }
    
    .modal-dialog {
        margin: 10px;
    }
    
    .canvas-toolbar .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .canvas-toolbar .btn {
        margin-bottom: 5px;
        width: 100%;
    }
    
    /* Improve mobile sidebar */
    .logo-controls-sidebar {
        width: 100%;
        max-width: 100vw;
    }
    
    .control-section {
        padding: 15px;
    }
    
    .control-section h5 {
        font-size: 1.1rem;
        margin-bottom: 1.2rem;
    }
    
    .form-control, .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
    }
    
    .form-range {
        margin: 10px 0;
    }
}

/* Loading States */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Success States */
.success-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    padding: 10px;
    margin-top: 10px;
}

/* Fabric.js Custom Styles */
.canvas-container {
    position: relative !important;
}

.upper-canvas {
    cursor: grab !important;
}

.upper-canvas:active {
    cursor: grabbing !important;
}

/* Hide fabric.js selection styles we want to customize */
.fabric-wrapper {
    box-shadow: none !important;
}

/* Custom selection styles */
.canvas-container .fabric-wrapper .upper-canvas {
    outline: none !important;
}

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

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Custom Scrollbar */
.logo-controls-sidebar::-webkit-scrollbar {
    width: 6px;
}

.logo-controls-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.logo-controls-sidebar::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.logo-controls-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Print Styles */
@media print {
    .navbar, .logo-controls-sidebar, .canvas-toolbar, .canvas-info {
        display: none !important;
    }
    
    .canvas-area {
        width: 100% !important;
        padding: 0 !important;
    }
    
    #canvasWrapper {
        box-shadow: none !important;
        padding: 0 !important;
    }
}

/* Noun Project Custom Icon Grid */
.custom-icon-grid .noun-icon-thumb {
    transition: box-shadow 0.2s;
}
.custom-icon-grid .noun-icon-thumb:hover {
    box-shadow: 0 0 0 2px #007bff;
}