/* Custom CSS for AnySecret.io */

/* Alpine.js x-cloak directive */
[x-cloak] {
    display: none !important;
}

/* Gradient text utility */
.gradient-text {
    background: linear-gradient(90deg, #6366f1, #818cf8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Code block styling */
.code-block {
    background: #f8fafc;
    border-radius: 0.5rem;
    border-left: 4px solid #6366f1;
    max-width: 100%;
    overflow: hidden;
}

/* Dark mode code block */
.dark .code-block {
    background: #1e293b;
    border-left-color: #818cf8;
}

/* Code block content responsiveness */
.code-block pre {
    overflow-x: auto;
    white-space: pre;
    word-wrap: break-word;
    max-width: 100%;
}

/* Mobile specific code styling */
@media (max-width: 768px) {
    .code-block {
        margin: 0 -1rem; /* Extend to edges on mobile */
        border-radius: 0;
        width: calc(100vw - 2rem); /* Force width to viewport minus padding */
        max-width: calc(100vw - 2rem);
        min-width: 0; /* Remove any minimum width constraints */
    }
    
    .code-block pre {
        font-size: 0.75rem; /* Smaller text on mobile */
        padding: 0.75rem; /* Adjust padding */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        width: 100%;
        max-width: 100%;
        min-width: 0; /* Remove minimum width */
        box-sizing: border-box;
    }
    
    .code-block .px-6 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Force code content to be contained */
    .code-block code {
        display: block;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow: visible;
        word-break: break-all; /* Break long words/commands if needed */
    }
    
    /* Tab container mobile adjustments */
    .code-block .flex {
        flex-wrap: wrap;
        gap: 0;
    }
}

/* Code line styling */
.code-line {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    color: #1e293b;
}

.dark .code-line {
    color: #e2e8f0;
}

/* Syntax highlighting colors for light mode */
.code-block .text-pink-400 {
    color: #ec4899 !important;
}

.code-block .text-blue-400 {
    color: #3b82f6 !important;
}

.code-block .text-green-400 {
    color: #10b981 !important;
}

.code-block .text-purple-400 {
    color: #a855f7 !important;
}

.code-block .text-orange-400 {
    color: #f97316 !important;
}

/* Dark mode syntax highlighting - keep existing */
.dark .code-block .text-pink-400 {
    color: #f9a8d4 !important;
}

.dark .code-block .text-blue-400 {
    color: #93c5fd !important;
}

.dark .code-block .text-green-400 {
    color: #86efac !important;
}

.dark .code-block .text-purple-400 {
    color: #c084fc !important;
}

.dark .code-block .text-orange-400 {
    color: #fdba74 !important;
}

/* Dark mode toggle styles */
.toggle-checkbox:checked {
    right: 0;
    border-color: #6366f1;
}

.toggle-checkbox:checked + .toggle-label {
    background-color: #6366f1;
}

.toggle-checkbox {
    transition: all 0.3s ease-in-out;
    cursor: pointer;
}

.toggle-label {
    transition: all 0.3s ease-in-out;
    cursor: pointer;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Custom animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out;
}

/* Custom hover effects */
.hover-scale {
    transition: transform 0.2s ease-in-out;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Custom button styles */
.btn-primary {
    @apply px-6 py-3 rounded-md bg-primary-light hover:bg-primary-dark text-white font-medium shadow-lg transform transition hover:scale-105;
}

.btn-secondary {
    @apply px-6 py-3 rounded-md bg-white dark:bg-slate-800 hover:bg-slate-100 dark:hover:bg-slate-700 text-slate-800 dark:text-slate-200 border border-slate-200 dark:border-slate-600 font-medium shadow transform transition hover:scale-105;
}

/* Copy button animation */
.copy-btn {
    transition: all 0.2s ease-in-out;
}

.copy-btn:hover {
    background-color: #475569;
}

/* Hero section specific styles */
.hero-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Feature card hover effects */
.feature-card {
    transition: all 0.3s ease-in-out;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* Responsive typography */
@media (max-width: 640px) {
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    /* Ensure mobile content doesn't overflow */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Tab buttons responsive */
    .code-block .px-4 {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        font-size: 0.75rem !important;
    }
    
    /* Force mobile code blocks to stay within viewport */
    .lg\\:w-1\\/2 {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow: hidden;
    }
    
    /* Prevent any element from causing horizontal scroll */
    * {
        max-width: 100vw;
    }
    
    body {
        overflow-x: hidden;
    }
}

/* Dark mode specific styles */

.dark .toggle-label {
    background-color: #475569;
}

/* Accessibility improvements */
.focus-visible:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

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

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.dark ::-webkit-scrollbar-track {
    background: #1e293b;
}

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

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

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* HTMX Styles */
.htmx-indicator {
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.htmx-request .htmx-indicator {
    opacity: 1;
}

.htmx-request.htmx-indicator {
    opacity: 1;
}

/* Modal animations */
.modal-enter {
    opacity: 0;
    transform: scale(0.95);
}

.modal-enter-active {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.3s, transform 0.3s;
}

.modal-leave {
    opacity: 1;
    transform: scale(1);
}

.modal-leave-active {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s, transform 0.3s;
}

/* Form validation styles */
.form-error {
    border-color: #ef4444;
}

.form-error:focus {
    ring-color: #ef4444;
    border-color: #ef4444;
}