/**
 * Dynamic Features CSS
 * Styles for notifications, live search, and animations
 */

/* ============================================
   NOTIFICATIONS
   ============================================ */

#notification-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: linear-gradient(135deg, #e91e63, #ff4081);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.notification-item {
    padding: 12px 20px;
    border-bottom: 1px solid #eee;
    transition: all 0.3s ease;
}

.notification-item:hover {
    background-color: #f8f9fa;
    transform: translateX(5px);
}

.notification-item.unread {
    background-color: #fff3f8;
    border-left: 3px solid #e91e63;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-right: 12px;
}

.notification-icon.interest {
    background: linear-gradient(135deg, #ff6b9d, #c44569);
    color: white;
}

.notification-icon.message {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
}

.notification-icon.view {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

/* ============================================
   LIVE SEARCH
   ============================================ */

.search-container {
    position: relative;
}

#search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.suggestion-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.suggestion-item:hover {
    background: linear-gradient(135deg, #fff0f5, #ffe6f0);
    transform: translateX(5px);
}

.suggestion-item:last-child {
    border-bottom: none;
}

/* Search Input Enhancement */
.search-input-enhanced {
    position: relative;
}

.search-input-enhanced input {
    padding-right: 40px;
}

.search-input-enhanced .search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
}

.search-loading {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.search-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #e91e63;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-notification {
    position: fixed;
    top: 80px;
    right: -400px;
    min-width: 300px;
    max-width: 400px;
    background: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9999;
    transition: right 0.3s ease;
}

.toast-notification.show {
    right: 20px;
}

.toast-notification i {
    font-size: 24px;
}

.toast-success {
    border-left: 4px solid #28a745;
}

.toast-success i {
    color: #28a745;
}

.toast-error {
    border-left: 4px solid #dc3545;
}

.toast-error i {
    color: #dc3545;
}

.toast-warning {
    border-left: 4px solid #ffc107;
}

.toast-warning i {
    color: #ffc107;
}

.toast-info {
    border-left: 4px solid #17a2b8;
}

.toast-info i {
    color: #17a2b8;
}

/* ============================================
   PROFILE CARDS (with animations)
   ============================================ */

.profile-card {
    transition: all 0.3s ease;
    border: none;
    overflow: hidden;
}

.profile-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(233, 30, 99, 0.2) !important;
}

.profile-card img {
    transition: transform 0.3s ease;
}

.profile-card:hover img {
    transform: scale(1.05);
}

.profile-card .card-footer {
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
}

/* ============================================
   LOADING ANIMATIONS
   ============================================ */

.skeleton-loader {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #e91e63;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

/* ============================================
   STAT CARDS (animated)
   ============================================ */

.stat-card {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border: none;
    border-left: 4px solid #e91e63;
    transition: all 0.3s ease;
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(233, 30, 99, 0.15);
    border-left-width: 6px;
}

.stat-card .stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, #e91e63, #9c27b0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   PROGRESS BARS (enhanced)
   ============================================ */

/* ============================================
   GLOBAL RESPONSIVE HELPERS
   ============================================ */

/* Make images scale within containers */
img, .img-fluid, .profile-photo, .profile-photo-small {
    max-width: 100%;
    height: auto;
}

/* Ensure embedded media scales */
.responsive-embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
}
.responsive-embed iframe,
.responsive-embed video,
.responsive-embed embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Tables: prevent overflow on small screens */
.table-responsive {
    overflow-x: auto;
}

/* Prevent long words from breaking layouts */
.text-wrap-break {
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

/* Cards and sections spacing on small screens */
@media (max-width: 576px) {
    .hero-section { padding: 40px 0; }
    .stats-card { margin: 8px 0; }
    .footer { padding-top: 24px; }
}

.progress-enhanced {
    height: 30px;
    border-radius: 15px;
    background: #e9ecef;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-enhanced .progress-bar {
    background: linear-gradient(90deg, #e91e63, #9c27b0);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: width 0.6s ease;
}

/* ============================================
   FORM VALIDATION (Real-time)
   ============================================ */

.form-control.is-valid {
    border-color: #28a745;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.validation-feedback {
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.valid-feedback {
    color: #28a745;
}

.invalid-feedback {
    color: #dc3545;
}

/* ============================================
   BADGE ANIMATIONS
   ============================================ */

.badge-animated {
    animation: badge-pop 0.3s ease;
}

@keyframes badge-pop {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* ============================================
   BUTTON EFFECTS
   ============================================ */

.btn-dynamic {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-dynamic::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-dynamic:hover::before {
    width: 300px;
    height: 300px;
}

/* ============================================
   MODAL ANIMATIONS
   ============================================ */

.modal.fade .modal-dialog {
    transform: scale(0.8);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.modal.show .modal-dialog {
    transform: scale(1);
    opacity: 1;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .toast-notification {
        min-width: 250px;
        max-width: 90%;
    }
    
    #search-suggestions {
        max-height: 300px;
    }
    
    .stat-card .stat-number {
        font-size: 2rem;
    }
}

/* ============================================
   SMOOTH SCROLLING
   ============================================ */

html {
    scroll-behavior: smooth;
}

/* ============================================
   FADE-IN ANIMATIONS
   ============================================ */

.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-delay {
    animation: fadeIn 0.5s ease 0.2s backwards;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.cursor-pointer {
    cursor: pointer;
}

.hover-scale:hover {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

.shadow-dynamic {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.shadow-dynamic:hover {
    box-shadow: 0 8px 20px rgba(233, 30, 99, 0.2);
}
