/* Custom styles for Toolsetly */

/* Global Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #2563eb 0%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* File upload area */
.upload-area {
    border: 2px dashed #cbd5e0;
    border-radius: 0.5rem;
    padding: 3rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #4299e1;
    background-color: #ebf8ff;
}

.upload-area.dragover {
    border-color: #3182ce;
    background-color: #bee3f8;
}

/* Tool card */
.tool-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Button styles */
.btn-primary {
    background-color: #4299e1;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.btn-primary:hover {
    background-color: #3182ce;
}

.btn-secondary {
    background-color: #718096;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.btn-secondary:hover {
    background-color: #4a5568;
}

/* Loading spinner */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4299e1;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* Progress bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: #4299e1;
    transition: width 0.3s ease;
}

/* Alert messages */
.alert {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.alert-error {
    background-color: #fed7d7;
    color: #742a2a;
    border: 1px solid #fc8181;
}

.alert-info {
    background-color: #bee3f8;
    color: #2c5282;
    border: 1px solid #90cdf4;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .upload-area {
        padding: 2rem 1rem;
    }
}

/* Code output area */
.code-output {
    background-color: #1a202c;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 0.375rem;
    font-family: 'Courier New', monospace;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

/* File preview */
.file-preview {
    max-width: 100%;
    max-height: 400px;
    border-radius: 0.375rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Tool description */
.tool-description {
    line-height: 1.8;
    color: #4a5568;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: #718096;
}

.breadcrumb a {
    color: #4299e1;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Line clamp utilities for blog posts */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Navigation - Prevent wrapping */
nav .container > div:first-child {
    flex-wrap: nowrap;
}

/* Make navigation items more compact */
@media (min-width: 1024px) {
    nav .container > div:first-child > div:last-of-type {
        white-space: nowrap;
    }
}

/* Mega Menu Styles */
.mega-menu {
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 0.5rem;
    width: 20rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 50;
}

.mega-menu-group:hover .mega-menu,
.mega-menu-group.active .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Ensure mega menu stays visible when hovering over it */
.mega-menu:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Mega menu positioning improvements */
.group:hover .absolute {
    pointer-events: auto;
}

/* Ensure mega menu doesn't go off screen on right side */
@media (min-width: 1024px) {
    .group:last-of-type .absolute {
        right: 0;
        left: auto;
    }
}

/* Mobile menu improvements */
@media (max-width: 768px) {
    .mega-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        width: 100%;
        margin-top: 0;
    }
    
    .mobile-menu-category button {
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    
    .mobile-menu-category button:active {
        background-color: rgba(37, 99, 235, 0.1);
    }
    
    #mobile-menu {
        border-top: 1px solid #e5e7eb;
        margin-top: 0.5rem;
        padding-top: 1rem;
    }
    
    .mobile-menu-category > div.hidden {
        display: none;
    }
    
    .mobile-menu-category > div:not(.hidden) {
        display: block;
        animation: slideDown 0.3s ease-out;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

