/**
 * Sprint 7: Recommendations & Notifications CSS
 * Bahrain Skills Platform
 */

/* Recommendations Section */
.recommendations-section {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.recommendations-section h5 {
    color: #333;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.recommendations-section h5 i {
    color: #E60026;
}

/* Recommended Projects Grid */
.recommended-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.recommended-project-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 18px;
    transition: all 0.3s ease;
    position: relative;
}

.recommended-project-card:hover {
    border-color: #E60026;
    box-shadow: 0 4px 15px rgba(230, 0, 38, 0.15);
    transform: translateY(-2px);
}

.recommended-project-card .match-score {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #E60026 0%, #B8001F 100%);
    color: #fff;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
}

.recommended-project-card .project-title {
    font-weight: 600;
    color: #333;
    font-size: 15px;
    margin-bottom: 8px;
    padding-right: 60px;
}

.recommended-project-card .project-title a {
    color: #333;
    text-decoration: none;
}

.recommended-project-card .project-title a:hover {
    color: #E60026;
}

.recommended-project-card .project-budget {
    color: #27ae60;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 10px;
}

.recommended-project-card .match-reasons {
    font-size: 12px;
    color: #666;
}

.recommended-project-card .match-reasons span {
    display: inline-block;
    background: #e8f4f8;
    color: #0077b5;
    padding: 3px 8px;
    border-radius: 4px;
    margin: 2px 4px 2px 0;
}

/* Project Actions */
.recommended-project-card .project-actions {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid #e9ecef;
}

.recommended-project-card .btn-submit-proposal {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #E60026 0%, #B8001F 100%);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.recommended-project-card .btn-submit-proposal:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(230, 0, 38, 0.4);
    color: #fff;
}

.recommended-project-card .btn-submit-proposal i {
    font-size: 12px;
}

/* High Demand Skills */
.high-demand-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.skill-demand-badge {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.skill-demand-badge:hover {
    border-color: #E60026;
    background: #fff0f1;
}

.skill-demand-badge .skill-name {
    font-weight: 500;
    color: #333;
}

.skill-demand-badge .demand-count {
    background: #e74c3c;
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

.skill-add-btn {
    background: #E60026;
    color: #fff;
    border: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}
.skill-add-btn:hover { background: #B8001F; }
.skill-add-btn:disabled { cursor: default; opacity: 0.8; }

/* Notification Bell */
.notification-bell {
    position: relative;
    cursor: pointer;
    padding: 8px;
}

.notification-bell i {
    font-size: 20px;
    color: #555;
    transition: color 0.2s;
}

.notification-bell:hover i {
    color: #E60026;
}

.notification-bell .badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #e74c3c;
    color: #fff;
    font-size: 10px;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Notification Badge - Override for header bell */
#notification-badge {
    position: absolute;
    top: -8px;
    right: -5px;
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    line-height: 1;
    padding: 0;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.notification-nav .side_message {
    position: relative;
    display: inline-block;
}

.notification-nav .side_message i.fa-bell {
    font-size: 20px;
    color: #555;
}

/* Notification Dropdown */
.notification-dropdown {
    position: absolute;
    top: 100%;
    right: -50px;
    width: 380px;
    max-height: 450px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.15);
    z-index: 9999;
    display: none;
    overflow: hidden;
}

@media (max-width: 480px) {
    .notification-dropdown {
        width: 320px;
        right: -100px;
    }
}

.notification-dropdown.show {
    display: block;
    animation: slideDown 0.2s ease;
}

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

.notification-dropdown-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-dropdown-header h6 {
    margin: 0;
    font-weight: 600;
    color: #333;
}

.notification-dropdown-header a {
    font-size: 13px;
    color: #E60026;
    text-decoration: none;
}

.notification-dropdown-body {
    max-height: 350px;
    overflow-y: auto;
}

.notification-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    gap: 12px;
    transition: background 0.2s;
    cursor: pointer;
}

.notification-item:hover {
    background: #f8f9fa;
}

.notification-item.unread {
    background: #fff0f1;
    border-left: 4px solid #E60026;
}

.notification-item.unread:hover {
    background: #ffe8ea;
}

.notification-item.unread .title {
    font-weight: 700;
}

.notification-item.unread .icon {
    opacity: 1;
}

/* Read notifications - dimmed styling */
.notification-item:not(.unread) {
    opacity: 0.7;
    border-left: 4px solid transparent;
}

.notification-item:not(.unread):hover {
    opacity: 1;
}

.notification-item .icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-item .icon.project {
    background: #e8f5e9;
    color: #27ae60;
}

.notification-item .icon.match {
    background: #e3f2fd;
    color: #2196f3;
}

.notification-item .icon.system {
    background: #fff3e0;
    color: #f57c00;
}

.notification-item .content {
    flex: 1;
    min-width: 0; /* Allow text truncation in flex child */
    overflow: hidden;
}

.notification-item .content .title {
    font-weight: 500;
    color: #333;
    font-size: 14px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-item .content .message {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.notification-item .content .time {
    font-size: 11px;
    color: #999;
}

.notification-dropdown-footer {
    padding: 12px 15px;
    text-align: center;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}

.notification-dropdown-footer a {
    color: #E60026;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.notification-dropdown-footer a i {
    font-size: 12px;
}

/* Empty State */
.notification-empty {
    padding: 40px 20px;
    text-align: center;
    color: #999;
}

.notification-empty i {
    font-size: 48px;
    margin-bottom: 15px;
    color: #ddd;
}

/* Notification Preferences Page */
.notification-preferences {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.notification-preferences h4 {
    color: #333;
    margin-bottom: 25px;
    font-weight: 600;
}

.preference-group {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.preference-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.preference-group h6 {
    color: #333;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.preference-group h6 i {
    color: #E60026;
}

.preference-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}

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

.preference-item .label {
    font-size: 14px;
    color: #333;
}

.preference-item .description {
    font-size: 12px;
    color: #888;
    margin-top: 3px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
}

.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: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #E60026 0%, #B8001F 100%);
}

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

/* Follow Buttons */
.follow-btn {
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 13px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.follow-btn.follow {
    background: #E60026;
    color: #fff;
}

.follow-btn.follow:hover {
    background: #CC0022;
}

.follow-btn.following {
    background: #e8f5e9;
    color: #27ae60;
    border: 1px solid #27ae60;
}

.follow-btn.following:hover {
    background: #ffebee;
    color: #e74c3c;
    border-color: #e74c3c;
}

/* Responsive */
@media (max-width: 768px) {
    .notification-dropdown {
        width: 100%;
        right: -50%;
        transform: translateX(50%);
    }

    .recommended-projects-grid {
        grid-template-columns: 1fr;
    }
}

/* RTL Support */
[dir="rtl"] .notification-dropdown {
    right: auto;
    left: 0;
}

[dir="rtl"] .notification-item {
    flex-direction: row-reverse;
}

[dir="rtl"] .recommended-project-card .match-score {
    right: auto;
    left: 12px;
}

[dir="rtl"] .recommended-project-card .project-title {
    padding-right: 0;
    padding-left: 60px;
}

/* =====================================================
   AZ-22: Combined Notifications + Messages Dropdown
   ===================================================== */

/* Combined Alerts Bell */
.combined-alerts-nav {
    position: relative;
}

.combined-alerts-bell {
    cursor: pointer;
}

/* Fix badge centering */
.combined-alerts-nav .messages_counter,
#combined-alerts-badge {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 11px;
    line-height: 1;
}

/* Combined Alerts Dropdown - wider to accommodate tabs */
.combined-alerts-dropdown {
    width: 420px;
    max-height: 500px;
}

@media (max-width: 480px) {
    .combined-alerts-dropdown {
        width: 340px;
        right: -120px;
    }
}

/* Tab Navigation */
.alerts-tabs {
    display: flex;
    border-bottom: 2px solid #eee;
    background: #f8f9fa;
}

.alerts-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 15px;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    transition: all 0.2s ease;
}

.alerts-tab:hover {
    background: #fff;
    color: #333;
}

.alerts-tab.active {
    background: #fff;
    color: #E60026;
    font-weight: 600;
}

.alerts-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #E60026;
}

.alerts-tab i {
    font-size: 16px;
}

/* Tab Badge */
.tab-badge {
    background: #E60026;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.alerts-tab:not(.active) .tab-badge {
    background: #aaa;
}

/* Tab Content */
.alerts-tab-content {
    display: none;
}

.alerts-tab-content.active {
    display: block;
}

/* Message Item Styling */
.message-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    gap: 12px;
    transition: background 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.message-item:hover {
    background: #f8f9fa;
    text-decoration: none;
    color: inherit;
}

.message-item.unread {
    background: #fff0f1;
    border-left: 4px solid #E60026;
}

.message-item.unread:hover {
    background: #ffe8ea;
}

.message-item .avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.message-item .avatar-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #E60026 0%, #B8001F 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
}

.message-item .content {
    flex: 1;
    min-width: 0;
}

.message-item .sender-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-item.unread .sender-name {
    font-weight: 700;
}

.message-item .message-preview {
    color: #666;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.message-item .message-time {
    font-size: 11px;
    color: #999;
}

.message-item .message-time i {
    margin-right: 4px;
}

/* Messages Empty State */
.messages-empty {
    padding: 40px 20px;
    text-align: center;
    color: #999;
}

.messages-empty i {
    font-size: 48px;
    margin-bottom: 15px;
    color: #ddd;
}

/* RTL Support for Tabs */
[dir="rtl"] .alerts-tabs {
    flex-direction: row-reverse;
}

[dir="rtl"] .alerts-tab {
    flex-direction: row-reverse;
}

[dir="rtl"] .message-item {
    flex-direction: row-reverse;
}

[dir="rtl"] .message-item .message-time i {
    margin-right: 0;
    margin-left: 4px;
}
