/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d1d1d1;
    border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb {
    background: #3c3c3c;
}

/* Text Selection */
::selection {
    background: rgba(0, 122, 204, 0.2);
}

.dark ::selection {
    background: rgba(14, 99, 156, 0.2);
}

/* Editor Styles */
textarea {
    tab-size: 2;
    white-space: pre;
    line-height: 1.5;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Animations */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Toast Messages */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.error-message,
.success-message {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 0;
    min-width: 200px;
    max-width: 300px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    animation: slideIn 0.3s ease-out;
}

.error-message {
    background-color: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.dark .error-message {
    background-color: #7f1d1d;
    color: #fecaca;
    border: 1px solid #991b1b;
}

.success-message {
    background-color: #dcfce7;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.dark .success-message {
    background-color: #14532d;
    color: #bbf7d0;
    border: 1px solid #166534;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Drag and Drop Area */
.drag-active {
    background-color: #f3f3f3;
    border-color: #007acc;
}

.dark .drag-active {
    background-color: #2a2d2e;
    border-color: #0e639c;
}

/* Image Preview */
#imagePreview img,
#imageOutput img {
    max-height: 300px;
    object-fit: contain;
}

/* Button Hover Effects */
button {
    transition: all 0.2s ease;
}

button:hover {
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
} 