/* Custom styles for the Proxmox Sizing Calculator */

/* Fix body layout to ensure footer stays at bottom */
html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

.nav-btn.active {
    border-bottom-color: white !important;
    background-color: rgba(255, 255, 255, 0.1);
}

.tab-content {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Dark mode transitions */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

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

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #E55722;
}

/* Result cards styling */
.result-card {
    background: linear-gradient(135deg, #FF6B35 0%, #FF8A65 100%);
    color: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px -3px rgba(0, 0, 0, 0.1);
}

.result-value {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.result-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Warning and success indicators */
.warning {
    background: linear-gradient(135deg, #F59E0B 0%, #FBBF24 100%);
}

.success {
    background: linear-gradient(135deg, #10B981 0%, #34D399 100%);
}

.danger {
    background: linear-gradient(135deg, #EF4444 0%, #F87171 100%);
}

/* Progress bars */
.progress-bar {
    height: 8px;
    background-color: #E5E7EB;
    border-radius: 4px;
    overflow: hidden;
}

.dark .progress-bar {
    background-color: #4B5563;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FF6B35 0%, #FF8A65 100%);
    transition: width 0.3s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    .nav-btn {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }
}

/* Animation for adding/removing VMs */
.vm-config {
    transition: all 0.3s ease;
}

.vm-config.removing {
    opacity: 0;
    transform: translateX(-100%);
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* Enhanced Tooltip styles */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 280px;
    background-color: #1F2937;
    color: white;
    text-align: left;
    border-radius: 8px;
    padding: 12px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -140px;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    font-size: 0.875rem;
    line-height: 1.4;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1F2937 transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

.dark .tooltip .tooltiptext {
    background-color: #374151;
    border: 1px solid #4B5563;
}

.dark .tooltip .tooltiptext::after {
    border-color: #374151 transparent transparent transparent;
}

/* Mobile tooltip adjustments */
@media (max-width: 768px) {
    .tooltip .tooltiptext {
        width: 250px;
        margin-left: -125px;
        font-size: 0.8rem;
    }
}

/* Loading spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #FF6B35;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tooltip Styles */
.tooltip-container {
    position: relative;
    display: inline-block;
}

.tooltip {
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1f2937;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: normal;
    max-width: 250px;
    width: max-content;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    line-height: 1.4;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1f2937;
}

.tooltip-container:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

/* Dark mode tooltip */
.dark .tooltip {
    background-color: #374151;
    border: 1px solid #4b5563;
}

.dark .tooltip::after {
    border-top-color: #374151;
}

/* Scripts specific styles */
.script-category {
    transition: all 0.3s ease;
}

.script-category:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.script-item {
    transition: all 0.3s ease;
}

.script-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#scriptCode {
    max-height: 400px;
    overflow-y: auto;
    line-height: 1.5;
}

/* Custom scrollbar for script code */
#scriptCode::-webkit-scrollbar {
    width: 8px;
}

#scriptCode::-webkit-scrollbar-track {
    background: #1f2937;
    border-radius: 4px;
}

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

#scriptCode::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* Responsive Design */
@media (max-width: 640px) {
    .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    /* Adjust card padding on mobile */
    .bg-white, .bg-gray-800 {
        margin-left: 0.25rem;
        margin-right: 0.25rem;
    }
    
    /* Stack form elements vertically on very small screens */
    .grid-cols-2 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
    
    /* Reduce spacing on mobile */
    .space-y-4 > * + * {
        margin-top: 0.75rem;
    }
    
    /* Smaller buttons on mobile */
    button {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    /* Adjust tooltip positioning for mobile */
    .tooltip {
        position: fixed;
        z-index: 1000;
        left: 50% !important;
        transform: translateX(-50%) !important;
        top: auto !important;
        bottom: 10px !important;
        max-width: 90vw;
    }
}

@media (max-width: 768px) {
    /* Tablet adjustments */
    .gap-8 {
        gap: 1rem;
    }
    
    .p-6 {
        padding: 1rem;
    }
    
    /* Ensure proper text wrapping */
    .whitespace-nowrap {
        white-space: normal;
    }
}

/* Mobile menu specific styles */
.bg-proxmox-orange-dark {
    background-color: #d97706;
}

/* Ensure mobile navigation is properly styled */
@media (max-width: 768px) {
    .nav-btn {
        border-bottom: none !important;
    }
    
    .mobile-nav-btn:hover {
        background-color: rgba(0, 0, 0, 0.1);
    }
    
    .mobile-nav-btn.active {
        background-color: rgba(0, 0, 0, 0.2);
    }
}

/* Touch-friendly sizing for mobile devices */
@media (hover: none) and (pointer: coarse) {
    button, input, select {
        min-height: 44px; /* Apple's recommended touch target size */
    }
    
    .script-category, .nav-btn {
        min-height: 48px;
    }
}

/* Landscape phone adjustments */
@media (max-width: 896px) and (orientation: landscape) {
    .py-8 {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    
    .mb-6 {
        margin-bottom: 1rem;
    }
}