/* Custom styles for Base Converter Tool */

/* Copy button copied state */
#copy-btn.copied {
    background-color: #22c55e; /* green-500 */
    transform: scale(1.05);
    transition: all 0.2s ease;
}

/* Enhanced button hover effects */
button, .btn {
    transition: all 0.2s ease;
    transform: translateY(0);
}

button:hover, .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Input focus effects */
input:focus, select:focus {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

/* Result display animations */
#result {
    transition: all 0.3s ease;
}

#result:not(:empty) {
    animation: fadeInUp 0.5s ease;
}

/* Steps container animations */
#steps-container {
    transition: all 0.3s ease;
}

#steps-container:not(:empty) {
    animation: slideInLeft 0.5s ease;
}

/* History item animations */
#history li {
    transition: all 0.2s ease;
    transform: translateX(0);
}

#history li:hover {
    transform: translateX(5px);
    background-color: rgba(99, 102, 241, 0.1);
}

/* Quick conversion button animations */
#quick-conversions button {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#quick-conversions button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

#quick-conversions button:hover::before {
    left: 100%;
}

#quick-conversions button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

/* Theme toggle button effects */
#theme-toggle {
    transition: all 0.3s ease;
}

#theme-toggle:hover {
    transform: rotate(180deg);
    background-color: rgba(99, 102, 400, 0.1);
}

/* Navigation link hover effects */
nav a {
    transition: all 0.2s ease;
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #6366f1;
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

/* Card hover effects */
.bg-white, .bg-gray-800 {
    transition: all 0.3s ease;
}

.bg-white:hover, .bg-gray-800:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Dark mode specific enhancements */
.dark .bg-gray-800:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #6366f1;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Error message animations */
#error-message {
    animation: shake 0.5s ease;
}

/* Responsive design enhancements */
@media (max-width: 768px) {
    .grid {
        gap: 1rem;
    }
    
    .p-8 {
        padding: 1.5rem;
    }
    
    .text-4xl {
        font-size: 2rem;
    }
    
    .text-2xl {
        font-size: 1.5rem;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus indicators for keyboard navigation */
button:focus, input:focus, select:focus, a:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .bg-gray-100, .bg-gray-200, .bg-gray-700, .bg-gray-800 {
        background-color: white !important;
        color: black !important;
    }
    
    button, #theme-toggle {
        display: none !important;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.dark ::-webkit-scrollbar-track {
    background: #1e293b;
}

.dark ::-webkit-scrollbar-thumb {
    background: #475569;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Enhanced form styling */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.dark .form-label {
    color: #d1d5db;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.dark .form-input {
    background-color: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

.dark .form-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Enhanced button styling */
.btn-primary {
    background-color: #6366f1;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background-color: #5855eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background-color: #4b5563;
    transform: translateY(-2px);
}

/* Success and error states */
.success {
    color: #059669;
    background-color: #d1fae5;
    border: 1px solid #a7f3d0;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

.error {
    color: #dc2626;
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

.dark .success {
    background-color: #064e3b;
    border-color: #065f46;
}

.dark .error {
    background-color: #450a0a;
    border-color: #7f1d1d;
}

/* Tooltip styles */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #1f2937;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Progress bar for conversions */
.progress-bar {
    width: 100%;
    height: 4px;
    background-color: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background-color: #6366f1;
    width: 0%;
    transition: width 0.3s ease;
}

/* Enhanced table styles */
.conversion-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.conversion-table th,
.conversion-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.conversion-table th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.dark .conversion-table th {
    background-color: #374151;
    color: #f9fafb;
}

.dark .conversion-table td {
    border-bottom-color: #4b5563;
}

/* Code block styling */
.code-block {
    background-color: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    overflow-x: auto;
}

.dark .code-block {
    background-color: #1f2937;
    border-color: #374151;
    color: #f9fafb;
}

/* Responsive grid improvements */
.grid-responsive {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Enhanced spacing utilities */
.space-y-6 > * + * {
    margin-top: 1.5rem;
}

.space-y-8 > * + * {
    margin-top: 2rem;
}

.space-y-10 > * + * {
    margin-top: 2.5rem;
}

/* Print-friendly styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .bg-white, .bg-gray-800 {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
}

/* --- Additions for Image to PDF Converter --- */

/* Style for the file upload area when dragging a file over it */
#upload-area.dragging {
  border-color: #6366f1; /* Corresponds to Tailwind's indigo-500 */
  background-color: #f0f1ff; /* A light indigo background */
}

.dark #upload-area.dragging {
  border-color: #818cf8; /* Corresponds to Tailwind's indigo-400 */
  background-color: #3730a3; /* A darker indigo background */
}