/* ===================================================
   NOTIFICATION SYSTEM STYLES — Budget Pro
   =================================================== */

/* Toggle Switch Component */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: rgba(255, 255, 255, 0.6);
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: rgba(99, 102, 241, 0.3);
    border-color: rgba(99, 102, 241, 0.5);
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
    background-color: rgb(99, 102, 241);
}

input:focus + .toggle-slider {
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Notification Center Badge Pulse */
#topbar-notif-badge {
    animation: badge-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes badge-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* Notification Item Hover */
.notification-item {
    transition: all 0.2s ease;
}

.notification-item:hover {
    transform: translateX(4px);
    background: rgba(255, 255, 255, 0.06);
}

.notification-item:hover button {
    opacity: 1 !important;
}

/* Filter Buttons */
.notif-filter-btn {
    transition: all 0.2s ease;
}

.notif-filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Notification Toast Animation */
.notification {
    animation: notif-slide-in 0.3s ease-out;
    position: relative;
    overflow: hidden;
}

@keyframes notif-slide-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification.dismissing {
    animation: notif-slide-out 0.3s ease-in forwards;
}

@keyframes notif-slide-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Progress Bar */
.notif-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    transform-origin: left;
    animation: notif-progress var(--notif-duration, 5000ms) linear;
}

@keyframes notif-progress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

.notification:hover .notif-progress {
    animation-play-state: paused;
}

/* Custom Range Slider */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgb(99, 102, 241);
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgb(99, 102, 241);
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

/* Time Input Styling */
input[type="time"] {
    color-scheme: dark;
}

html.light input[type="time"] {
    color-scheme: light;
}

/* Modal Backdrop Animation */
.modal-backdrop {
    animation: fade-in 0.2s ease-out;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-backdrop > div {
    animation: modal-slide-up 0.3s ease-out;
}

@keyframes modal-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Notification Categories Icons */
.notification-item [class*="bg-rose"] {
    box-shadow: 0 0 20px rgba(244, 63, 94, 0.1);
}

.notification-item [class*="bg-emerald"] {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.1);
}

.notification-item [class*="bg-blue"] {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.1);
}

.notification-item [class*="bg-amber"] {
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.1);
}

.notification-item [class*="bg-purple"] {
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.1);
}

/* Empty State */
.notification-item:empty::before {
    content: "Brak powiadomień";
    display: block;
    text-align: center;
    padding: 3rem;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.875rem;
}

/* Loading Spinner for Settings */
.settings-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: rgb(99, 102, 241);
    animation: spinner-rotate 0.6s linear infinite;
}

@keyframes spinner-rotate {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Adjustments */
@media (max-width: 640px) {
    #notification-center-modal > div {
        max-height: 90vh;
        margin: 1rem;
    }
    
    #notification-settings-modal > div {
        margin: 1rem;
    }
    
    .notification-item {
        padding: 0.75rem;
    }
    
    .notif-filter-btn {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }
}

/* Dark/Light Theme Support */
html.light .toggle-slider {
    background-color: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.1);
}

html.light .toggle-slider:before {
    background-color: rgba(0, 0, 0, 0.4);
}

html.light input:checked + .toggle-slider {
    background-color: rgba(99, 102, 241, 0.2);
}

html.light input:checked + .toggle-slider:before {
    background-color: rgb(99, 102, 241);
}

html.light input[type="range"] {
    background: rgba(0, 0, 0, 0.1);
}

html.light .notification-item {
    background: rgba(255, 255, 255, 0.8);
}

html.light .notification-item:hover {
    background: rgba(255, 255, 255, 1);
}

/* Accessibility */
.toggle-switch:focus-within .toggle-slider {
    outline: 2px solid rgb(99, 102, 241);
    outline-offset: 2px;
}

button:focus-visible {
    outline: 2px solid rgb(99, 102, 241);
    outline-offset: 2px;
}

/* Smooth Transitions */
* {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}
/* ===================================================
   SETTINGS NOTIFICATIONS STYLES
   =================================================== */

/* Mniejszy toggle switch */
.toggle-switch-sm {
    width: 36px;
    height: 20px;
}

.toggle-switch-sm .toggle-slider:before {
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
}

.toggle-switch-sm input:checked + .toggle-slider:before {
    transform: translateX(16px);
}

/* Smooth transitions */
#notification-advanced-settings {
    animation: slideDown 0.3s ease-out;
}

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

#notif-advanced-icon {
    transition: transform 0.3s ease;
}