/* ============================================
   Interactive Tools - Al-Haseen Insurance
   أدوات تفاعلية احترافية
   ============================================ */

/* ============ 1. Live Status Indicator ============ */
.live-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #28a745;
    font-weight: 600;
}

.live-status-dot {
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    animation: pulse-dot 1.5s infinite;
    position: relative;
}

.live-status-dot::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    width: 14px;
    height: 14px;
    background: rgba(40, 167, 69, 0.3);
    border-radius: 50%;
    animation: pulse-ring 1.5s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes pulse-ring {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* ============ 2. Click-to-Call (Mobile Only) ============ */
.click-to-call-btn {
    display: none;
    position: fixed;
    bottom: 80px;
    left: 20px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #28a745, #20c997);
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
    z-index: 9998;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    animation: bounce-call 2s infinite;
}

.click-to-call-btn svg {
    width: 26px;
    height: 26px;
    fill: white;
}

.click-to-call-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.5);
}

.click-to-call-btn .call-tooltip {
    position: absolute;
    bottom: 65px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.click-to-call-btn:hover .call-tooltip {
    opacity: 1;
}

@keyframes bounce-call {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-8px); }
    60% { transform: translateY(-4px); }
}

@media (max-width: 768px) {
    .click-to-call-btn {
        display: flex;
    }
}

/* ============ 3. Trust Bar ============ */
.trust-bar-section {
    background: #f8f9fa;
    padding: 30px 0;
    border-top: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
    overflow: hidden;
}

.trust-bar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.trust-bar-title {
    font-size: 13px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
    font-weight: 600;
}

.trust-bar-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.trust-bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    filter: grayscale(50%);
}

.trust-bar-item:hover {
    opacity: 1;
    filter: grayscale(0%);
}

.trust-bar-item svg {
    width: 48px;
    height: 48px;
}

.trust-bar-item span {
    font-size: 11px;
    color: #6c757d;
    font-weight: 500;
    text-align: center;
    max-width: 100px;
}

/* ============ 4. Countdown Timer ============ */
.countdown-banner {
    background: linear-gradient(135deg, #1a3a5c 0%, #0d2137 100%);
    padding: 15px 20px;
    position: relative;
    overflow: hidden;
}

.countdown-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.countdown-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.countdown-text {
    color: white;
    font-size: 14px;
    font-weight: 600;
}

.countdown-text .offer-badge {
    background: #e74c3c;
    color: white;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    margin-left: 8px;
    margin-right: 8px;
    animation: flash-badge 1.5s infinite;
}

@keyframes flash-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.countdown-timer {
    display: flex;
    gap: 8px;
    align-items: center;
}

.countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    padding: 6px 10px;
    min-width: 50px;
}

.countdown-unit .number {
    font-size: 20px;
    font-weight: 700;
    color: #f1c40f;
    line-height: 1;
}

.countdown-unit .label {
    font-size: 9px;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    margin-top: 3px;
}

.countdown-separator {
    color: #f1c40f;
    font-size: 20px;
    font-weight: 700;
}

.countdown-cta {
    background: #f1c40f;
    color: #1a3a5c;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.countdown-cta:hover {
    background: #f39c12;
    transform: scale(1.05);
}

.countdown-close {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    z-index: 2;
}

.countdown-close:hover {
    color: white;
}

/* ============ 5. Testimonials Carousel ============ */
.testimonials-section {
    padding: 80px 0;
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
}

.testimonials-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.testimonials-header {
    text-align: center;
    margin-bottom: 50px;
}

.testimonials-header .section-badge {
    display: inline-block;
    background: rgba(26, 58, 92, 0.1);
    color: #1a3a5c;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 15px;
}

.testimonials-header h2 {
    font-size: 32px;
    color: #1a3a5c;
    margin: 0;
    font-weight: 700;
}

.testimonials-slider {
    position: relative;
    overflow: hidden;
}

.testimonials-track {
    display: flex;
    transition: transform 0.5s ease;
}

.testimonial-card {
    min-width: 33.333%;
    padding: 0 15px;
    box-sizing: border-box;
}

@media (max-width: 992px) {
    .testimonial-card { min-width: 50%; }
}

@media (max-width: 576px) {
    .testimonial-card { min-width: 100%; }
}

.testimonial-inner {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.testimonial-inner:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
}

.testimonial-stars {
    color: #f1c40f;
    font-size: 16px;
    margin-bottom: 15px;
}

.testimonial-text {
    color: #555;
    font-size: 14px;
    line-height: 1.8;
    flex: 1;
    margin-bottom: 20px;
    font-style: italic;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid #e9ecef;
    padding-top: 15px;
}

.testimonial-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a3a5c, #2c5f8a);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
}

.testimonial-info h4 {
    margin: 0;
    font-size: 14px;
    color: #1a3a5c;
    font-weight: 600;
}

.testimonial-info p {
    margin: 2px 0 0;
    font-size: 12px;
    color: #6c757d;
}

.testimonials-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.testimonials-nav button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #1a3a5c;
    background: white;
    color: #1a3a5c;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.testimonials-nav button:hover {
    background: #1a3a5c;
    color: white;
}

/* ============ 6. Interactive Branches Map ============ */
.branches-map-section {
    padding: 80px 0;
    background: white;
}

.branches-map-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.branches-map-header {
    text-align: center;
    margin-bottom: 50px;
}

.branches-map-header .section-badge {
    display: inline-block;
    background: rgba(26, 58, 92, 0.1);
    color: #1a3a5c;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 15px;
}

.branches-map-header h2 {
    font-size: 32px;
    color: #1a3a5c;
    margin: 0;
    font-weight: 700;
}

.branches-map-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

@media (max-width: 768px) {
    .branches-map-content {
        grid-template-columns: 1fr;
    }
}

.branches-map-visual {
    position: relative;
    background: linear-gradient(135deg, #f0f4f8, #e8edf2);
    border-radius: 16px;
    padding: 30px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.libya-map-svg {
    width: 100%;
    max-width: 350px;
    height: auto;
}

.map-pin {
    cursor: pointer;
    transition: all 0.3s ease;
}

.map-pin:hover {
    transform: scale(1.3);
}

.map-pin.active circle {
    fill: #e74c3c;
}

.branches-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 450px;
    overflow-y: auto;
    padding-right: 10px;
}

.branch-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}

.branch-card:hover,
.branch-card.active {
    border-color: #1a3a5c;
    box-shadow: 0 4px 15px rgba(26, 58, 92, 0.1);
    background: #f8fafc;
}

.branch-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #1a3a5c, #2c5f8a);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.branch-icon svg {
    width: 22px;
    height: 22px;
    fill: white;
}

.branch-details h4 {
    margin: 0;
    font-size: 15px;
    color: #1a3a5c;
    font-weight: 600;
}

.branch-details p {
    margin: 4px 0 0;
    font-size: 12px;
    color: #6c757d;
}

.branch-details .branch-phone {
    color: #28a745;
    font-weight: 600;
}

/* ============ 7. Mini Insurance Calculator ============ */
.mini-calculator-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #1a3a5c 0%, #0d2137 100%);
    position: relative;
    overflow: hidden;
}

.mini-calculator-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(241, 196, 15, 0.1), transparent);
    border-radius: 50%;
}

.mini-calc-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.mini-calc-header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.mini-calc-header .section-badge {
    display: inline-block;
    background: rgba(241, 196, 15, 0.2);
    color: #f1c40f;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 15px;
}

.mini-calc-header h2 {
    font-size: 32px;
    margin: 0 0 10px;
    font-weight: 700;
    color: white;
}

.mini-calc-header p {
    color: rgba(255,255,255,0.7);
    font-size: 15px;
    margin: 0;
}

.mini-calc-form {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.calc-steps {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
}

.calc-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #6c757d;
}

.calc-step.active {
    color: #1a3a5c;
    font-weight: 600;
}

.calc-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.calc-step.active .calc-step-num {
    background: #1a3a5c;
    color: white;
}

.calc-step.done .calc-step-num {
    background: #28a745;
    color: white;
}

.calc-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

@media (max-width: 576px) {
    .calc-fields { grid-template-columns: 1fr; }
}

.calc-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.calc-field label {
    font-size: 13px;
    color: #555;
    font-weight: 600;
}

.calc-field select,
.calc-field input {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 14px;
    transition: border-color 0.3s;
    outline: none;
    font-family: inherit;
}

.calc-field select:focus,
.calc-field input:focus {
    border-color: #1a3a5c;
}

.calc-result {
    display: none;
    text-align: center;
    padding: 25px;
    background: linear-gradient(135deg, #f0f9f0, #e8f5e9);
    border-radius: 12px;
    border: 1px solid #c8e6c9;
    margin-top: 20px;
}

.calc-result.show {
    display: block;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.calc-result .price {
    font-size: 36px;
    font-weight: 700;
    color: #1a3a5c;
    margin: 10px 0;
}

.calc-result .price-note {
    font-size: 13px;
    color: #6c757d;
}

.calc-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #1a3a5c, #2c5f8a);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.calc-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(26, 58, 92, 0.3);
}

/* ============ RTL Support ============ */
[dir="rtl"] .click-to-call-btn {
    left: auto;
    right: 20px;
}

[dir="rtl"] .countdown-close {
    right: auto;
    left: 15px;
}

[dir="rtl"] .branches-list {
    padding-right: 0;
    padding-left: 10px;
}

/* ============ Responsive ============ */
@media (max-width: 768px) {
    .countdown-content {
        flex-direction: column;
        gap: 12px;
    }
    .countdown-unit {
        min-width: 40px;
        padding: 5px 8px;
    }
    .countdown-unit .number {
        font-size: 16px;
    }
    .trust-bar-logos {
        gap: 20px;
    }
    .testimonials-header h2,
    .branches-map-header h2,
    .mini-calc-header h2 {
        font-size: 24px;
    }
    .mini-calc-form {
        padding: 25px;
    }
}
