/* Custom styles for Developer Tools */

/* Override Bootstrap variables for consistency */
:root {
    --bs-font-monospace: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

/* Global styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Code and monospace text styling */
code, pre, .font-monospace {
    font-family: var(--bs-font-monospace);
    font-size: 0.9em;
}

/* Card hover effects */
.card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

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

/* Tool cards on homepage */
.card .fa-3x {
    font-size: 2.5rem;
    opacity: 0.8;
}

/* Password strength indicators */
.password-item {
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.password-item:hover {
    border-left-color: var(--bs-primary);
    background-color: var(--bs-light);
}

/* JSON output styling */
#json-output {
    font-size: 0.85rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-all;
}

/* QR code display */
#qr-display img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
}

/* Cron examples list */
.list-group-item-action {
    cursor: pointer;
    transition: all 0.2s ease;
}

.list-group-item-action:hover {
    transform: translateX(5px);
}

/* Loading states */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card .fa-3x {
        font-size: 2rem;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .btn-group-vertical .btn {
        margin-bottom: 0.25rem;
    }
}

/* Dark mode specific adjustments */
[data-bs-theme="dark"] {
    .card {
        background-color: var(--bs-dark);
        border-color: var(--bs-gray-700);
    }
    
    .password-item:hover {
        background-color: var(--bs-gray-800);
    }
    
    .list-group-item-action {
        background-color: var(--bs-dark);
        border-color: var(--bs-gray-700);
        color: var(--bs-light);
    }
    
    .list-group-item-action:hover {
        background-color: var(--bs-gray-800);
    }
}

/* Utility classes */
.text-break-all {
    word-break: break-all;
}

.border-start-primary {
    border-left: 3px solid var(--bs-primary) !important;
}

.border-start-success {
    border-left: 3px solid var(--bs-success) !important;
}

.border-start-warning {
    border-left: 3px solid var(--bs-warning) !important;
}

.border-start-danger {
    border-left: 3px solid var(--bs-danger) !important;
}

/* Copy button animation */
.btn-copy {
    position: relative;
    overflow: hidden;
}

.btn-copy.copied {
    background-color: var(--bs-success);
    border-color: var(--bs-success);
    color: white;
}

.btn-copy.copied::after {
    content: 'Copied!';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bs-success);
}

/* Form enhancements */
.form-control:focus,
.form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Table styling */
.table-responsive {
    border-radius: 0.375rem;
}

.table th {
    border-top: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

/* Alert improvements */
.alert {
    border: none;
    border-radius: 0.5rem;
    border-left: 4px solid;
}

.alert-success {
    border-left-color: var(--bs-success);
}

.alert-danger {
    border-left-color: var(--bs-danger);
}

.alert-warning {
    border-left-color: var(--bs-warning);
}

.alert-info {
    border-left-color: var(--bs-info);
}

/* Sidebar Navigation */
.sidebar {
    width: 60px;
    min-height: 100vh;
    background: var(--bs-body-bg);
    border-right: 1px solid var(--bs-border-color);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 10px 0;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar-bottom {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding-top: 10px;
    border-top: 1px solid var(--bs-border-color);
}

.sidebar-item {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--bs-body-color);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    position: relative;
}

.sidebar-item:hover {
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
    transform: scale(1.1);
    text-decoration: none;
}

.sidebar-item.active {
    background: var(--bs-primary);
    color: white;
}

/* Dropdown for language selector */
.sidebar .dropdown-menu {
    left: 50px !important;
    bottom: 0 !important;
    top: auto !important;
    transform: none !important;
}

/* Main content area */
.main-content {
    margin-left: 60px;
    width: calc(100% - 60px);
    min-height: 100vh;
    padding: 20px;
}

/* Main content without sidebar */
.main-content.no-sidebar {
    margin-left: 0;
    width: 100%;
}

/* Adjust Bootstrap containers for sidebar */
.main-content .container,
.main-content .container-fluid {
    max-width: none;
    padding-left: 15px;
    padding-right: 15px;
}

/* Home page specific containers (full width) */
.main-content.no-sidebar .container,
.main-content.no-sidebar .container-fluid {
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 15px;
    padding-right: 15px;
}

/* Responsive design */
@media (max-width: 768px) {
    .sidebar {
        width: 50px;
    }
    
    .sidebar-item {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .main-content {
        margin-left: 50px;
        width: calc(100% - 50px);
        padding: 15px;
    }
    
    .main-content.no-sidebar {
        margin-left: 0;
        width: 100%;
        padding: 15px;
    }
    
    .main-content .container,
    .main-content .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .main-content.no-sidebar .container,
    .main-content.no-sidebar .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Floating controls responsive */
    .floating-controls {
        top: 15px;
        right: 15px;
        gap: 8px;
    }
    
    .floating-controls .btn {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }
    
    .floating-controls #theme-toggle {
        font-size: 1.1rem;
    }
}

/* Theme-specific styles for sidebar */
[data-bs-theme="dark"] .sidebar {
    background: #212529;
    border-right-color: #495057;
}

[data-bs-theme="dark"] .sidebar-bottom {
    border-top-color: #495057;
}

[data-bs-theme="light"] .sidebar {
    background: #ffffff;
    border-right-color: #dee2e6;
}

[data-bs-theme="light"] .sidebar-bottom {
    border-top-color: #dee2e6;
}

/* Keep original theme toggle styles */
#theme-toggle {
    transition: all 0.3s ease;
    text-decoration: none !important;
    color: inherit !important;
}

#theme-toggle:hover {
    transform: scale(1.1);
    text-decoration: none !important;
}

#theme-toggle:focus {
    text-decoration: none !important;
    box-shadow: none;
}

#theme-toggle i {
    transition: transform 0.3s ease;
}

/* Floating controls for home page */
.floating-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
    display: flex;
    gap: 10px;
    align-items: center;
}

.floating-controls .btn {
    font-size: 1.5rem;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.floating-controls .btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.floating-controls #theme-toggle {
    font-size: 1.2rem;
}

/* Language dropdown styles */
#languageDropdown {
    text-decoration: none !important;
    color: inherit !important;
}

#languageDropdown:hover,
#languageDropdown:focus {
    text-decoration: none !important;
    color: inherit !important;
}

#theme-toggle:hover i {
    transform: rotate(20deg);
}

/* Loading states */
.btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn.loading .fa-spinner {
    animation: spin 1s linear infinite;
}

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

/* Loading overlay for forms */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 0.375rem;
}

[data-bs-theme="dark"] .loading-overlay {
    background: rgba(33, 37, 41, 0.8);
}

.loading-spinner {
    font-size: 1.5rem;
    color: var(--bs-primary);
}

/* Smooth theme transitions */
html {
    transition: color-scheme 0.3s ease;
}

html[data-bs-theme="dark"] {
    color-scheme: dark;
}

html[data-bs-theme="light"] {
    color-scheme: light;
}

/* Ensure proper contrast for elements in both themes */
.navbar {
    transition: all 0.3s ease;
}

.card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, background-color 0.3s ease, border-color 0.3s ease;
}

/* Enhanced theme support */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark theme specific styles */
[data-bs-theme="dark"] {
    --bs-body-bg: #212529;
    --bs-body-color: #dee2e6;
}

[data-bs-theme="dark"] .card {
    --bs-card-bg: #2d3338;
    --bs-card-border-color: #495057;
}

[data-bs-theme="dark"] .navbar {
    background-color: #1a1d20 !important;
    border-bottom: 1px solid #495057;
}

[data-bs-theme="dark"] .btn-outline-primary {
    --bs-btn-color: #6ea8fe;
    --bs-btn-border-color: #6ea8fe;
    --bs-btn-hover-bg: #6ea8fe;
    --bs-btn-hover-border-color: #6ea8fe;
}

/* Light theme specific styles */
[data-bs-theme="light"] {
    --bs-body-bg: #ffffff;
    --bs-body-color: #212529;
}

[data-bs-theme="light"] .card {
    --bs-card-bg: #ffffff;
    --bs-card-border-color: #dee2e6;
}

[data-bs-theme="light"] .navbar {
    background-color: #f8f9fa !important;
    border-bottom: 1px solid #dee2e6;
}

[data-bs-theme="light"] .btn-outline-primary {
    --bs-btn-color: #0d6efd;
    --bs-btn-border-color: #0d6efd;
    --bs-btn-hover-bg: #0d6efd;
    --bs-btn-hover-border-color: #0d6efd;
}

/* Enhanced card hover effects for both themes */
[data-bs-theme="dark"] .card:hover {
    box-shadow: 0 .5rem 1rem rgba(255, 255, 255, .1);
}

[data-bs-theme="light"] .card:hover {
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
}

/* Code blocks styling for both themes */
[data-bs-theme="dark"] code,
[data-bs-theme="dark"] pre {
    background-color: #2d3338;
    color: #f8f9fa;
}

[data-bs-theme="light"] code,
[data-bs-theme="light"] pre {
    background-color: #f8f9fa;
    color: #212529;
}

/* Language selector styling */
#languageDropdown {
    text-decoration: none !important;
    transition: transform 0.2s ease;
}

#languageDropdown:hover {
    transform: scale(1.1);
    text-decoration: none !important;
}

#languageDropdown:focus {
    text-decoration: none !important;
    box-shadow: none;
}
