/* Base64 Image Converter Custom Styles */

/* Use system CSS variables to avoid conflicts */
body {
    background-color: var(--surface-color, #f8fafc);
}

/* Remove generic header styles to avoid conflicts with system styles */

/* Card Styles */
.card {
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Button Group Styles */
.btn-group .btn {
    font-size: 0.875rem;
}

/* Form Controls */
.form-control, .form-select {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    border-radius: 0.375rem;
}

#base64Input, #base64Output {
    resize: vertical;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    background-color: #ffffff;
    border: none;
    padding: 1rem;
}

#base64Input {
    background-color: #ffffff;
}

#base64Output {
    background-color: #f8f9fa;
    color: #495057;
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--border-color, #dee2e6);
    border-radius: 0.5rem;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--primary-color, #0d6efd);
    background-color: rgba(13, 110, 253, 0.05);
    transform: scale(1.02);
}

.drop-zone.dragover {
    border-style: solid;
}

.drop-zone-content {
    text-align: center;
}

/* Image Preview */
.image-preview-wrapper {
    text-align: center;
}

#imagePreview, #resultImage {
    max-width: 100%;
    max-height: 400px;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.image-info {
    margin-top: 1rem;
}

#imageFileName {
    font-weight: 500;
    color: var(--text-primary, #1e293b);
}

#imageDetails {
    font-size: 0.875rem;
    color: var(--text-secondary, #64748b);
}

/* Image Result */
#imageResultContainer {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#noImagePlaceholder {
    color: var(--text-secondary, #64748b);
}

.image-result-info {
    margin-top: 1rem;
}

/* Statistics */
.stat-item {
    padding: 1rem 0;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color, #0d6efd);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Status Bar */
.alert {
    border-radius: 0.5rem;
}

.alert-success {
    background-color: #d1e7dd;
    border-color: #badbcc;
    color: #0f5132;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffecb5;
    color: #664d03;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c2c7;
    color: #721c24;
}

.alert-info {
    background-color: #cff4fc;
    border-color: #b6effb;
    color: #055160;
}

/* Loading Animation */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color, #0d6efd);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Badge Styles */
.badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}

/* Copy Button Animation */
.copy-success {
    animation: copyPulse 0.6s ease;
}

@keyframes copyPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Hero Actions */
.hero-actions {
    margin-top: 1.5rem;
}

.hero-actions .btn {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .oidn-container {
        padding: 0 0.5rem;
    }

    .card-body .row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .btn-group {
        flex-wrap: wrap;
        justify-content: center;
    }

    .btn-group .btn {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    .stat-item {
        padding: 0.5rem 0;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    #base64Input, #base64Output {
        font-size: 0.8rem;
    }

    .drop-zone {
        min-height: 200px;
        padding: 1rem;
    }

    #imagePreview, #resultImage {
        max-height: 250px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles */
.btn:focus,
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color, #0d6efd);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #ffffff;
    }

    .card {
        background-color: #2d2d2d;
        border-color: #404040;
    }

    .form-control,
    .form-select {
        background-color: #3d3d3d;
        border-color: #404040;
        color: #ffffff;
    }

    #base64Output {
        background-color: #2d2d2d;
        color: #ffffff;
    }

    .drop-zone {
        background-color: #2d2d2d;
        border-color: #404040;
    }

    #noImagePlaceholder {
        color: #adb5bd;
    }
}

/* Print Styles */
@media print {
    header,
    .card-header,
    .card-footer,
    .btn-group,
    .alert {
        display: none !important;
    }

    .oidn-container {
        max-width: none;
        padding: 0;
    }

    .row.g-3 {
        gap: 0;
    }

    .col-lg-6 {
        width: 100%;
        page-break-inside: avoid;
    }

    #base64Input,
    #base64Output {
        border: 1px solid #000;
        height: auto;
        page-break-inside: avoid;
    }
}

/* Text Utilities */
.text-break-all {
    word-break: break-all;
}

.text-nowrap {
    white-space: nowrap;
}

/* Overflow Utilities */
.overflow-scroll {
    overflow: scroll;
}

.overflow-hidden {
    overflow: hidden;
}

/* Custom animations */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

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