/* Apple-Style Notification System CSS */

/* Notification Bell in Header */
.apple-notification-bell-container {
    position: relative;
    margin-left: 0;
    margin-right: 0;
}

.apple-notification-bell {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.apple-notification-bell:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.apple-notification-bell:active {
    transform: scale(0.95);
}

.apple-notification-bell.has-notifications {
    animation: bellPulse 2s infinite;
}

@keyframes bellPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.apple-notification-bell svg {
    color: white;
    transition: color 0.3s ease;
}

.apple-notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: linear-gradient(135deg, #ff3b30, #ff6b6b);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(255, 59, 48, 0.3);
}

.apple-notification-badge.visible {
    opacity: 1;
    transform: scale(1);
}

/* Main Notification Container */
.apple-notification-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.apple-notification-container.active {
    opacity: 1;
    visibility: visible;
}

.apple-notification-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.apple-notification-panel {
    position: absolute;
    top: 80px;
    right: 16px;
    width: 340px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 120px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    transform: translateY(-20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.apple-notification-container.active .apple-notification-panel {
    transform: translateY(0) scale(1);
}

@media (max-width: 768px) {
    .apple-notification-panel {
        top: 70px;
        right: 8px;
        left: 8px;
        width: auto;
        max-width: none;
    }
}

/* Panel Header */
.apple-notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.1);
}

.apple-notification-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
}

.apple-notification-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6e6e73;
    transition: all 0.2s ease;
}

.apple-notification-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #1d1d1f;
}

/* Notification List */
.apple-notification-list {
    max-height: 400px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.apple-notification-list::-webkit-scrollbar {
    width: 4px;
}

.apple-notification-list::-webkit-scrollbar-track {
    background: transparent;
}

.apple-notification-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

/* Empty State */
.apple-notification-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #86868b;
    text-align: center;
}

.apple-notification-empty svg {
    margin-bottom: 12px;
    opacity: 0.5;
}

.apple-notification-empty p {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

/* Individual Notification Item */
.apple-notification-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    cursor: pointer;
    min-height: 60px; /* Ensure consistent minimum height */
}

.apple-notification-item:last-child {
    border-bottom: none;
}

.apple-notification-item:hover {
    background: rgba(0, 0, 0, 0.02);
    transform: translateX(2px);
}

.apple-notification-item.unread {
    background: rgba(0, 122, 255, 0.03);
    border-left: 3px solid #007aff;
}

.apple-notification-item.read {
    opacity: 0.7;
}

.apple-notification-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.05);
}

.notification-success .apple-notification-icon {
    background: linear-gradient(135deg, #34c759, #30d158);
    color: white;
}

.notification-error .apple-notification-icon {
    background: linear-gradient(135deg, #ff3b30, #ff6b6b);
    color: white;
}

.notification-warning .apple-notification-icon {
    background: linear-gradient(135deg, #ff9500, #ffb340);
    color: white;
}

.notification-info .apple-notification-icon {
    background: linear-gradient(135deg, #007aff, #5ac8fa);
    color: white;
}

.apple-notification-content {
    flex: 1;
    min-width: 0;
}

.apple-notification-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 4px;
}

.apple-notification-title-text {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1d1d1f;
    line-height: 1.3;
}

.apple-notification-dismiss {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #86868b;
    transition: all 0.2s ease;
    margin-left: 8px;
    flex-shrink: 0;
}

.apple-notification-dismiss:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #1d1d1f;
}

.apple-notification-message {
    margin: 0 0 6px 0;
    font-size: 13px;
    color: #6e6e73;
    line-height: 1.4;
}

/* Notification Details */
.notification-detail {
    margin: 4px 0;
    font-size: 12px;
    color: #86868b;
    line-height: 1.3;
    padding: 2px 8px;
    border-left: 2px solid rgba(0, 122, 255, 0.2);
    background: rgba(0, 122, 255, 0.02);
    border-radius: 0 4px 4px 0;
}

.notification-detail strong {
    color: #1d1d1f;
    font-weight: 600;
}

.notification-detail:first-of-type {
    margin-top: 6px;
}

.notification-detail:last-of-type {
    margin-bottom: 4px;
}

.apple-notification-time {
    font-size: 11px;
    color: #86868b;
    font-weight: 500;
    margin-top: 8px;
    display: block;
}

/* Dismissing Animation */
.apple-notification-item.dismissing {
    opacity: 0 !important;
    transform: translateX(100%) !important;
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

.apple-notification-unread-dot {
    position: absolute;
    top: 18px;
    left: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #007aff;
}

/* Panel Footer */
.apple-notification-footer {
    padding: 12px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.1);
}

.apple-clear-all-btn {
    width: 100%;
    background: linear-gradient(135deg, #007aff, #5ac8fa);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.apple-clear-all-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.apple-clear-all-btn:active {
    transform: translateY(0);
}

/* Toast Notifications */
.apple-toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 320px;
    max-width: calc(100vw - 40px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 16px;
    display: flex;
    align-items: flex-start;
    z-index: 10001;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.apple-toast-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.apple-toast-notification.removing {
    transform: translateX(100%);
    opacity: 0;
}

@media (max-width: 768px) {
    .apple-toast-notification {
        top: 80px;
        right: 16px;
        left: 16px;
        width: auto;
        max-width: none;
    }
}

.apple-toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.apple-toast-notification.notification-success .apple-toast-icon {
    background: linear-gradient(135deg, #34c759, #30d158);
    color: white;
}

.apple-toast-notification.notification-error .apple-toast-icon {
    background: linear-gradient(135deg, #ff3b30, #ff6b6b);
    color: white;
}

.apple-toast-notification.notification-warning .apple-toast-icon {
    background: linear-gradient(135deg, #ff9500, #ffb340);
    color: white;
}

.apple-toast-notification.notification-info .apple-toast-icon {
    background: linear-gradient(135deg, #007aff, #5ac8fa);
    color: white;
}

.apple-toast-content {
    flex: 1;
    min-width: 0;
}

.apple-toast-title {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: #1d1d1f;
    line-height: 1.3;
}

.apple-toast-message {
    margin: 0 0 4px 0;
    font-size: 13px;
    color: #6e6e73;
    line-height: 1.4;
}

/* Toast notification details */
.toast-detail {
    margin: 2px 0;
    font-size: 11px;
    color: #86868b;
    line-height: 1.3;
    font-style: italic;
    padding: 1px 4px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 3px;
    display: inline-block;
}

.apple-toast-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #86868b;
    transition: all 0.2s ease;
    margin-left: 8px;
    flex-shrink: 0;
}

.apple-toast-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #1d1d1f;
}

/* Animations */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Ensure proper stacking */
.apple-notification-container,
.apple-toast-notification {
    z-index: 999999;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .apple-notification-panel {
        top: 60px;
        right: 4px;
        left: 4px;
        border-radius: 12px;
    }
    
    .apple-notification-header,
    .apple-notification-item,
    .apple-notification-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .apple-toast-notification {
        top: 70px;
        right: 12px;
        left: 12px;
        padding: 12px;
    }
}
