/**
 * Kalkulačky Glykémia - Custom Styles
 * Extends Tailwind CSS with custom components
 */

/* Custom slider styling */
.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 24px;
    background: transparent;
    outline: none;
}

.slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #3b82f6, #1d4ed8);
}

.slider::-moz-range-track {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #3b82f6, #1d4ed8);
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    margin-top: -8px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #3b82f6;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.15s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border: 3px solid #3b82f6;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.15s ease;
}

.slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Input field focus animation */
input[type="number"]:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

/* Table row hover effect */
#basalTable tr {
    transition: background-color 0.15s ease;
}

/* Card hover effect */
.bg-white.rounded-xl {
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.bg-white.rounded-xl:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Mobile hamburger menu */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
}

.nav-toggle svg {
    width: 24px;
    height: 24px;
}

@media (max-width: 767px) {
    .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nav-menu {
        display: none !important;
        flex-direction: column;
        width: 100%;
        padding-bottom: 4px;
    }

    .nav-menu.open {
        display: flex !important;
    }

    .nav-menu li a {
        border-radius: 6px !important;
        margin: 1px 0;
    }
}

@media (min-width: 768px) {
    .nav-toggle {
        display: none !important;
    }

    .nav-menu {
        display: flex !important;
        gap: 4px;
    }
}

/* Responsive adjustments */
@media (max-width: 640px) {
    /* Larger touch targets on mobile */
    .slider {
        height: 28px;
    }

    .slider::-webkit-slider-runnable-track {
        height: 12px;
    }

    .slider::-moz-range-track {
        height: 12px;
    }

    .slider::-webkit-slider-thumb {
        width: 28px;
        height: 28px;
        margin-top: -8px;
    }

    .slider::-moz-range-thumb {
        width: 28px;
        height: 28px;
    }

    /* Adjust input size for mobile */
    input[type="number"] {
        font-size: 18px;
        padding: 14px 16px;
    }

    /* Adjust table font size */
    #basalTable {
        font-size: 14px;
    }
}

/* Print styles */
@media print {
    header, footer, .bg-yellow-50 {
        display: none;
    }

    .bg-white.rounded-xl {
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }

    body {
        background: white;
    }
}

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

/* Number input - hide spinner buttons */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* Chart container */
#basalChart {
    max-width: 100%;
}

/* Accessibility - focus visible */
*:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Animation for value changes */
@keyframes pulse-value {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

#lowerTdd, #totalBasal {
    transition: color 0.2s ease;
}
