/* ============================================
   CORE SIP STYLES
   ============================================ */
:root {
    --primary-text-color: #333;
    --disabled-color: #ccc;
    --shake-duration: 1.0s;
    --notification-z-index: 10001;
}

.sip-form {
    display: inline-block;
}

.sip-callee {
    display: inline-block;
    cursor: pointer;
}

.sip-callee.disabled,
.sip-callee {
    cursor: auto;
    filter: grayscale(100%);
}

.sip-callee.connect {
    filter: grayscale(0);
    cursor: pointer;
}

.sip-callee.calling {
    animation: shake var(--shake-duration) infinite;
}

.sip-callee.connected {
    filter:
        grayscale(100%)
        brightness(40%)
        sepia(100%)
        hue-rotate(-50deg)
        saturate(350%)
        contrast(1.6);
}

.connected {
    -webkit-filter: drop-shadow(0px 0px 10px rgba(0,200,0,0.9));
}

@keyframes shake {
    0%, 100% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
}

#connection-state {
    display: none;
}

.call-center-btn.disabled {
    color: var(--disabled-color);
    border: 1px solid var(--disabled-color);
    cursor: auto;
}

button.disabled:hover {
    color: var(--disabled-color);
    background-color: #fff;
}

.btn-group {
    display: inline-block;
}

.sip-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.in-call-keypad {
    position: relative;
    margin-top: 15px;
    width: 100%;
    max-width: 240px;
    z-index: 100;
}

.dial-row {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.dial-key {
    display: inline-block;
    width: 30%;
    border: 1px solid var(--disabled-color);
    margin: 0 5px;
}

.connecting {
    animation: connecting-animation 1s infinite;
}

@keyframes connecting-animation {
    0%, 49% {
        background-color: rgb(117,209,63);
        border-radius: 50%;
    }
    50%, 100% {
        border: 3px solid rgb(117,209,63);
        border-radius: 50%;
    }
}

/* ============================================
   BROWSER-SPECIFIC ADJUSTMENTS
   ============================================ */
.safari-browser .sip-callee {
    cursor: pointer;
}

/* Ensure audio elements are properly styled for all browsers */
#audio_remote {
    width: 0;
    height: 0;
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Browser warning styles */
.browser-warning {
    background: #ff9800;
    color: white;
    padding: 10px;
    text-align: center;
    margin-bottom: 10px;
    border-radius: 4px;
}

.browser-warning.hidden {
    display: none;
}

/* ============================================
   CALL CONTAINER & KEYPAD STYLES
   ============================================ */
.call-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.number-input {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.custom-number {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    width: 200px;
}

/* Keypad Styles */
.div-keypad {
    display: none;
    background: #f5f5f5;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Add red/sepia keypad button styles to match connected state */
.dial-key .btn {
    color: white !important;
    background: #c53030 !important; /* Red color that matches the sepia theme */
    border: 1px solid #9b2c2c !important;
    width: 100%;
    height: 50px;
    font-size: 18px;
    cursor: pointer;
    text-align: center;
    border-radius: 4px;
    font-weight: bold;
}

.dial-key .btn:hover {
    background: #9b2c2c !important; /* Darker red on hover */
}

.dial-key .btn:active {
    background: #742a2a !important; /* Even darker on click */
}

/* ============================================
   FEEDBACK MODAL STYLES
   ============================================ */

/* Ensure modal content is properly centered */
.sip-feedback-modal[style*="display: flex"] {
    display: flex !important;
}

.sip-feedback-modal[style*="display: block"] {
    display: flex !important;
}

/* Force modal to be on top of everything */
.sip-feedback-modal * {
    box-sizing: border-box !important;
}

/* Additional fixes for potential conflicts */
body.modal-open {
    overflow: hidden !important;
}

/* Make sure no other styles are interfering */
div[class*="feedback-modal"] {
    position: fixed !important;
    z-index: 99999 !important;
}

/* Simple Feedback Modal Styles */
.sip-feedback-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: rgba(0, 0, 0, 0.85) !important;
    display: none !important;
    justify-content: center !important;
    align-items: center !important;
    z-index: 99999 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    overflow: hidden !important;
}

.feedback-content {
    background: white !important;
    border-radius: 12px !important;
    padding: 40px !important;
    max-width: 500px !important;
    width: 90% !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7) !important;
    animation: slideUp 0.3s ease-out !important;
    border: 3px solid #fff !important;
    position: relative !important;
    z-index: 100000 !important;
    margin: 0 !important;
    display: block !important;
}

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

.feedback-content h3 {
    margin: 0 0 30px 0 !important;
    text-align: center !important;
    font-size: 24px !important;
    color: #333;
    font-weight: 600;
}

.feedback-content h4 {
    margin: 0 0 20px 0 !important;
    text-align: center !important;
    font-size: 20px !important;
    color: #333;
    font-weight: 600;
}

/* ============================================
   SATISFACTION ICONS - FIXED ALIGNMENT
   ============================================ */
.satisfaction-icons {
    display: flex !important;
    justify-content: center !important;
    gap: 60px !important;
    margin-bottom: 20px !important;
    align-items: flex-start !important;
}

.icon-choice {
    text-align: center !important;
    cursor: pointer !important;
    transition: transform 0.2s ease !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100px !important;
}

.icon-choice:hover {
    transform: scale(1.05) !important;
}

.icon-choice svg {
    display: block !important;
    width: 80px !important;
    height: 80px !important;
    margin: 0 0 12px 0 !important;
}

.icon-choice p {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #333 !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: center !important;
    line-height: 1.4 !important;
    width: 100% !important;
}

.icon-choice.happy:hover svg circle:first-child {
    fill: #45a049 !important;
}

.icon-choice.sad:hover svg circle:first-child {
    fill: #d32f2f !important;
}

/* ============================================
   COMMENT SECTION
   ============================================ */
.feedback-comment-section {
    text-align: center !important;
}

.feedback-comment-section textarea {
    width: 100% !important;
    padding: 14px !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    font-family: inherit !important;
    resize: vertical !important;
    margin-bottom: 10px !important;
    box-sizing: border-box !important;
    min-height: 100px !important;
    background: white !important;
}

.feedback-comment-section textarea:focus {
    outline: none !important;
    border-color: #f44336 !important;
}

.feedback-email {
    width: 100% !important;
    padding: 14px !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    font-family: inherit !important;
    margin: 10px 0 20px 0 !important;
    box-sizing: border-box !important;
    background: white !important;
}

.feedback-email:focus {
    outline: none !important;
    border-color: #f44336 !important;
}

.btn-submit-feedback {
    padding: 14px 32px !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 16px !important;
    font-weight: 600;
    cursor: pointer !important;
    background: #4CAF50 !important;
    color: white !important;
    transition: all 0.3s ease !important;
}

.btn-submit-feedback:hover {
    background: #45a049 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3) !important;
}

.btn-submit-feedback:disabled {
    background: #ccc !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* ============================================
   SOCIAL SHARE SECTION
   ============================================ */
.social-share-section {
    text-align: center !important;
}

.social-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px !important;
    margin-bottom: 25px !important;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center !important;
    gap: 12px !important;
    padding: 14px 20px !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    font-weight: 600;
    color: white !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
}

.social-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

.social-btn.twitter {
    background: #1DA1F2 !important;
}

.social-btn.twitter:hover {
    background: #1a8cd8 !important;
}

.social-btn.facebook {
    background: #4267B2 !important;
}

.social-btn.facebook:hover {
    background: #365899 !important;
}

.social-btn.reddit {
    background: #FF4500 !important;
}

.social-btn.reddit:hover {
    background: #e03d00 !important;
}

.social-btn svg {
    fill: white !important;
}

.btn-close-modal {
    padding: 12px 28px !important;
    border: 2px solid #ddd !important;
    border-radius: 6px !important;
    font-size: 16px !important;
    font-weight: 600;
    cursor: pointer !important;
    background: white !important;
    color: #666 !important;
    transition: all 0.3s ease !important;
}

.btn-close-modal:hover {
    background: #f5f5f5 !important;
    border-color: #999 !important;
}

/* ============================================
   RTL SUPPORT FOR ARABIC
   ============================================ */
[dir="rtl"] .feedback-content {
    direction: rtl !important;
    text-align: right !important;
}

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

[dir="rtl"] .icon-choice {
    text-align: center !important;
}

[dir="rtl"] .icon-choice p {
    text-align: center !important;
}

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

[dir="rtl"] .feedback-comment-section {
    text-align: right !important;
}

[dir="rtl"] .feedback-comment-section textarea {
    text-align: right !important;
}

[dir="rtl"] .feedback-email {
    text-align: right !important;
}

[dir="rtl"] .btn-submit-feedback,
[dir="rtl"] .btn-close-modal {
    direction: rtl !important;
}

/* Additional RTL fixes for form elements */
[dir="rtl"] input,
[dir="rtl"] textarea {
    text-align: right !important;
}

/* ============================================
   EDGE-SPECIFIC FIXES
   ============================================ */
@supports (-ms-ime-align:auto) {
    .sip-error-notification a {
        display: inline-block !important;
        background: rgba(255,255,255,0.2) !important;
        border: 2px solid rgba(255,255,255,0.4) !important;
    }
}

/* Microsoft Edge specific */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
    .sip-error-notification a {
        display: inline-block !important;
        background: rgba(255,255,255,0.2) !important;
        border: 2px solid rgba(255,255,255,0.4) !important;
        padding: 12px 24px !important;
    }
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .sip-container {
        width: 100%;
    }

    .in-call-keypad {
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .feedback-content {
        padding: 30px 20px !important;
        width: 95% !important;
    }
    
    .feedback-content h3 {
        font-size: 20px !important;
    }
    
    .satisfaction-icons {
        gap: 20px !important;
    }
    
    .icon-choice {
        width: 80px !important;
    }
    
    .icon-choice svg {
        width: 50px !important;
        height: 50px !important;
    }
    
    .icon-choice p {
        font-size: 12px !important;
    }
    
    .social-buttons {
        gap: 12px !important;
    }
    
    .social-btn {
        padding: 12px 16px !important;
        font-size: 15px !important;
    }

    /* RTL mobile adjustments */
    [dir="rtl"] .satisfaction-icons {
        flex-direction: row-reverse;
    }
}