/* Global Styles */
.tool-card {
    transition: all 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-5px);
}

/* Drag & Drop Styles */
.drag-over {
    border-color: #3B82F6 !important;
    background-color: #EFF6FF;
}

/* Custom Range Slider Styles */
input[type="range"] {
    height: 6px;
    background: #E5E7EB;
    border-radius: 5px;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #3B82F6;
    border-radius: 50%;
    cursor: pointer;
}

/* Loading Animation */
.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3B82F6;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

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

/* Search animations */
.fade-in {
    animation: fadeIn 0.3s ease-in forwards;
}

.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(10px);
    }
}

/* Search box styles */
.search-container {
    position: relative;
}

.search-input {
    padding-right: 5rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.clear-search {
    position: absolute;
    right: 2.5rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    background-color: rgba(59, 130, 246, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-search:hover {
    background-color: rgba(59, 130, 246, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.clear-search svg {
    width: 16px;
    height: 16px;
    color: #3B82F6;
    transition: transform 0.3s ease;
}

.clear-search:hover svg {
    transform: rotate(90deg);
}

/* Search icon positioning */
.search-container > svg {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
}

/* Search Results Styles */
.search-results {
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.search-results::-webkit-scrollbar {
    width: 6px;
}

.search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.search-results::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.search-results mark {
    background: rgba(59, 130, 246, 0.1);
    color: #1a56db;
}

.search-results a:hover mark {
    background: rgba(59, 130, 246, 0.2);
}

/* Search highlight styles */
.tool-item {
    transition: all 0.3s ease;
    position: relative;
}

.search-match {
    transform: scale(1.02);
    box-shadow: 
        0 10px 15px rgba(59, 130, 246, 0.1),
        0 4px 6px rgba(59, 130, 246, 0.05);
    border-color: rgba(59, 130, 246, 0.3);
}

/* Tools Grid Layout */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.3rem;
    padding: 0.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .tools-grid {
        gap: 0.5rem;
        padding: 1rem;
        grid-template-columns: repeat(3, 1fr);
    }
    
    .tool-item {
        height: 180px;
        border-radius: 0.75rem;
    }
}

@media (min-width: 1024px) {
    .tools-grid {
        gap: 0.5rem;
        padding: 1.5rem;
        grid-template-columns: repeat(4, 1fr);
    }
    
    .tool-item {
        height: 200px;
    }
}

/* Tool Card Styles */
.tool-item {
    
    background: white;
    border-radius: 0rem;
    padding: 1rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(59, 130, 246, 0.1);
    box-shadow: 
        0 4px 6px rgba(59, 130, 246, 0.05),
        0 1px 3px rgba(59, 130, 246, 0.1);
    width: 100%;
    height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.tool-item:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 10px 15px rgba(59, 130, 246, 0.1),
        0 4px 6px rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.3);
    background: linear-gradient(to bottom right, white, rgba(59, 130, 246, 0.05));
}

.tool-item .tool-icon {
    background: rgba(59, 130, 246, 0.05);
    padding: 0.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.tool-item .tool-icon svg {
    width: 35px;
    height: 35px;
}


.tool-item:hover .tool-icon {
    background: rgba(59, 130, 246, 0.1);
    transform: scale(1.05);
}

.tool-item h3 {
    color: #1F2937;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s ease;
}

.tool-item:hover h3 {
    color: #3B82F6;
}

.tool-item p {
    color: #6B7280;
    font-size: 0.875rem;
    line-height: 1.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: -5px; 
    margin-bottom: 0;
    padding: 0;
    font-weight: 400;
    max-width: 100%;
    transition: color 0.2s ease;
    position: relative; 
    top: -3px; 
}

.tool-item:hover p {
    color: #4B5563;
}

/* New Badge */
.new-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background-color: #10B981;
    color: white;
    padding: 4px 8px;
    border-radius: 1px;
    font-size: 0.60rem;
    font-weight: 500;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
    z-index: 10;
}


.new-badge {
    animation: pulse 2s infinite;
}

/* Mobile Adjustments */
@media (max-width: 640px) {
    .tool-item {
        height: 150px;
        padding: 0.75rem;
    }
    
    .tool-item .tool-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 0.75rem;
    }
    
    .tool-item .tool-icon svg {
        width: 35px;
        height: 35px;
    }
    
    .tool-item h3 {
        margin-bottom: 0.25rem;
        color: #1F2937;
     margin-bottom: 0.5rem;
      font-size: 0.9rem;
      transition: color 0.3s ease;
    }
    
    .tool-item p {
        font-size: 0.7rem;
        line-height: 1.2;
        -webkit-line-clamp: 3;
    }
}

/* Ensure containers don't cause overflow */
.container {
    width: 100%;
    max-width: 100vw;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

@media (min-width: 640px) {
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

/* Adjust grid gaps for mobile */
@media (max-width: 640px) {
    .grid {
        gap: 0.75rem;
    }
    
    /* Smaller text for mobile */
    .text-xl {
        font-size: 1rem;
    }
    
    .text-sm {
        font-size: 0.75rem;
    }
    
    /* Adjust padding for mobile cards */
    .p-6 {
        padding: 0.75rem;
    }
    
    /* Adjust icon sizes for mobile */
    .w-8 {
        width: 1.5rem;
    }
    
    .h-8 {
        height: 1.5rem;
    }
    
    /* Adjust margins for mobile */
    .mb-4 {
        margin-bottom: 0.5rem;
    }
    
    .mb-2 {
        margin-bottom: 0.25rem;
    }
    
    /* Footer mobile styles */
    footer .grid {
        text-align: center;
    }

    footer h4 {
        margin-top: 1.5rem;
    }

    footer ul {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    footer .grid > div:not(:first-child) {
        margin-top: 2rem;
    }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    /* Adjust font sizes */
    h1 {
        font-size: 1.5rem !important;
    }

    /* Adjust spacing */
    .space-y-4 > * + * {
        margin-top: 1rem;
    }

    /* Make range slider more touch-friendly */
    input[type="range"] {
        height: 8px;
    }

    input[type="range"]::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }

    /* Adjust input and select padding */
    input[type="text"],
    select {
        padding: 0.75rem;
    }

    /* Make drop zone more compact */
    #drop-zone {
        padding: 1.5rem;
    }

    #drop-zone .text-5xl {
        font-size: 3rem;
    }

    /* Adjust preview images */
    #original-preview,
    #compressed-preview {
        max-height: 200px;
        object-fit: contain;
    }

    /* Make buttons more touchable */
    button {
        min-height: 44px;
    }

    /* Center align footer headings */
    footer h4 {
        text-align: center !important;
        margin-bottom: 1rem;
    }

    /* Center align footer links */
    footer ul {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    footer ul li {
        text-align: center;
    }

    /* Center align footer sections */
    footer .grid > div {
        text-align: center;
    }

    /* Center align newsletter section */
    footer .newsletter-section {
        text-align: center;
    }

    /* Center align social media icons */
    footer .social-links {
        justify-content: center;
    }

    /* Center align copyright text */
    footer .copyright {
        text-align: center;
    }
}

/* Center alignment styles */
.text-center {
    text-align: center;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

/* Image preview container styles */
#preview-section img {
    max-width: 100%;
    display: block;
    margin: 0 auto;
}

/* Mobile responsive centering */
@media (max-width: 768px) {
    #preview-section .grid > div {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    #preview-section h3,
    #preview-section p {
        width: 100%;
        text-align: center;
    }
}

/* Upload area styles */
#drop-zone {
    transition: all 0.3s ease;
}

#drop-zone:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 
                0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Smooth transitions */
.transition-colors {
    transition-property: background-color, border-color, color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

/* Upload button hover effect */
button:hover {
    transform: translateY(-1px);
}

/* Drag overlay animation */
#drop-overlay {
    transition: opacity 0.3s ease;
}

#drop-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* File input focus styles */
input[type="file"]:focus + label {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

/* FAQ Accordion Styles */
.border.border-gray-200.rounded-lg button svg {
    transition: transform 0.3s ease;
}

.border.border-gray-200.rounded-lg button:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.border.border-gray-200.rounded-lg div {
    transition: all 0.3s ease;
}

.border.border-gray-200.rounded-lg div.hidden {
    display: none;
    opacity: 0;
    height: 0;
    padding: 0;
}

.border.border-gray-200.rounded-lg div:not(.hidden) {
    display: block;
    opacity: 1;
    height: auto;
}

/* Mobile-first title centering */
.tool-title {
    text-align: center;
    margin-bottom: 1rem;
}

/* Tool sections mobile centering */
@media (max-width: 768px) {
    .section-title {
        text-align: center !important;
    }

    .tool-section {
        text-align: center;
    }

    .tool-section h1,
    .tool-section h2,
    .tool-section h3,
    .tool-section h4 {
        text-align: center;
    }

    /* Format buttons container */
    .format-buttons {
        justify-content: center;
    }

    /* Quality slider label and value */
    .quality-control {
        text-align: center;
    }
    
    .quality-control .flex {
        justify-content: center;
    }

    /* Save As section */
    .save-as-section label {
        text-align: center;
    }

    /* Preview section headers */
    .preview-header {
        text-align: center;
    }

    /* How to use and Features sections */
    .feature-title,
    .how-to-title {
        text-align: center;
    }

    /* FAQ section */
    .faq-title {
        text-align: center;
    }
}

/* Footer title effects */
footer h4 {
    position: relative;
    display: inline-block;
    padding-bottom: 5px;
    transition: all 0.3s ease;
}

/* Hover effects */
@media (min-width: 768px) {
    footer h4:hover {
        color: #3B82F6;
        transform: translateY(-2px);
    }

    footer h4:hover::after {
        width: 100%;
        left: 0;
    }
}

/* Mobile specific styles */
@media (max-width: 767px) {
    footer h4 {
        padding-bottom: 8px;
    }

    footer h4::after {
        width: 40px;
        left: calc(50% - 20px);
        background-color: #3B82F6;
        height: 2px;
    }

    footer h4 {
        animation: titlePulse 2s infinite;
    }
}

