/**
 * Floating Chat Overlay Styles
 * Modern, responsive design for citizen feedback widget
 */

/* Chat Trigger Button */
.chat-trigger {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 9999;
    animation: pulse-chat 2s infinite;
}

.chat-trigger:hover {
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.6);
}

.chat-trigger.active {
    transform: scale(0.9);
    animation: none;
}

.chat-trigger i {
    color: white;
    font-size: 32px;
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    border: 3px solid white;
    animation: bounce-badge 1s infinite;
}

@keyframes pulse-chat {
    0%, 100% {
        box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 8px 35px rgba(102, 126, 234, 0.7);
    }
}

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

/* Chat Overlay Panel */
.chat-overlay {
    position: fixed;
    bottom: -100%;
    right: 30px;
    width: 420px;
    max-width: calc(100vw - 60px);
    max-height: 700px;
    height: 90vh;
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
    z-index: 9998;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
}

.chat-overlay.open {
    bottom: 30px;
    opacity: 1;
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    flex-shrink: 0;
}

.chat-header-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chat-header-content i {
    font-size: 32px;
}

.chat-header-content h5 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.chat-header-content small {
    font-size: 12px;
    opacity: 0.9;
}

.chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 20px;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Chat Body */
.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    background: #f8f9fa;
}

/* Welcome Section */
.chat-welcome {
    text-align: center;
    padding: 30px 0;
}

.welcome-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
    animation: wave-hand 2s infinite;
}

@keyframes wave-hand {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-10deg);
    }
    75% {
        transform: rotate(10deg);
    }
}

.chat-welcome h4 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.chat-welcome p {
    color: #7f8c8d;
    margin-bottom: 30px;
}

.feedback-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.option-btn {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    padding: 20px 15px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.option-btn:hover {
    border-color: #667eea;
    background: #f0f2ff;
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
}

.option-btn i {
    font-size: 32px;
    color: #667eea;
}

.option-btn span {
    font-size: 14px;
    color: #2c3e50;
    font-weight: 500;
}

/* Progress Steps */
.progress-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    padding: 0 10px;
}

.progress-step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #7f8c8d;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-weight: bold;
    transition: all 0.3s;
}

.progress-step.active .step-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.progress-step small {
    font-size: 12px;
    color: #7f8c8d;
    display: block;
}

.progress-step.active small {
    color: #667eea;
    font-weight: 600;
}

.progress-line {
    flex: 1;
    height: 2px;
    background: #e0e0e0;
    margin: 0 10px;
    position: relative;
    top: -15px;
}

/* Form Steps */
.form-step h5 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 500;
    font-size: 14px;
}

.form-group label i {
    margin-right: 5px;
    color: #667eea;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* Recording Controls */
.recording-controls {
    text-align: center;
    padding: 30px 0;
}

.record-btn,
.stop-btn {
    padding: 15px 40px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 10px;
}

.record-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.record-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.stop-btn {
    background: #ff4757;
    color: white;
}

.stop-btn:hover {
    background: #ff3838;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 71, 87, 0.4);
}

.recording-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
    padding: 15px;
    background: #fff5f5;
    border-radius: 10px;
}

.recording-indicator {
    width: 20px;
    height: 20px;
    background: #ff4757;
    border-radius: 50%;
    animation: blink-recording 1s infinite;
}

@keyframes blink-recording {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

.recording-timer {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    font-family: monospace;
}

.recording-preview {
    margin-top: 20px;
    text-align: center;
}

.recording-preview audio,
.recording-preview video {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 15px;
}

.re-record-btn {
    background: #f39c12;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.re-record-btn:hover {
    background: #e67e22;
    transform: translateY(-2px);
}

/* Video Preview */
.video-preview {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 10px;
    background: #000;
    margin-bottom: 15px;
}

/* Location Section */
.location-section {
    padding: 20px 0;
}

.btn-location {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-location:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-location:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.location-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: #d4edda;
    border-radius: 10px;
    margin: 15px 0;
}

.location-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #155724;
    font-weight: 500;
}

.location-info i {
    font-size: 20px;
}

.btn-change-location {
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
}

.btn-change-location:hover {
    background: #667eea;
    color: white;
}

.manual-location {
    margin-top: 20px;
}

/* Form Navigation */
.form-navigation {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.btn-secondary,
.btn-primary,
.btn-success {
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    font-size: 14px;
}

.btn-secondary {
    background: #e0e0e0;
    color: #2c3e50;
}

.btn-secondary:hover {
    background: #d0d0d0;
    transform: translateX(-2px);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateX(2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-success:hover {
    transform: translateX(2px);
    box-shadow: 0 6px 20px rgba(17, 153, 142, 0.4);
}

/* Review Summary */
.review-summary {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 2px solid #e0e0e0;
}

.review-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.review-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.review-item strong {
    color: #667eea;
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
}

.review-item span {
    color: #2c3e50;
    font-size: 14px;
}

/* Loading State */
.chat-loading {
    text-align: center;
    padding: 50px 0;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.chat-loading p {
    color: #7f8c8d;
    font-size: 16px;
}

/* Success Message */
.chat-success {
    text-align: center;
    padding: 50px 0;
}

.success-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 56px;
    animation: pop-success 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes pop-success {
    0% {
        transform: scale(0);
    }
    100% {
        transform: scale(1);
    }
}

.chat-success h4 {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.chat-success p {
    color: #7f8c8d;
    margin-bottom: 15px;
}

.reference-number {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
}

.reference-number strong {
    color: #667eea;
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-trigger {
        bottom: 20px;
        right: 20px;
        width: 60px;
        height: 60px;
    }
    
    .chat-trigger i {
        font-size: 28px;
    }
    
    .chat-overlay {
        right: 20px;
        left: 20px;
        width: calc(100vw - 40px);
        max-height: 85vh;
        bottom: -100%;
    }
    
    .chat-overlay.open {
        bottom: 20px;
    }
    
    .feedback-options {
        grid-template-columns: 1fr;
    }
    
    .option-btn {
        flex-direction: row;
        justify-content: flex-start;
        padding: 15px 20px;
    }
    
    .option-btn i {
        font-size: 24px;
        margin-right: 15px;
    }
    
    .progress-steps {
        flex-wrap: wrap;
    }
    
    .progress-line {
        display: none;
    }
    
    .form-navigation {
        flex-direction: column-reverse;
    }
    
    .form-navigation button {
        width: 100%;
        justify-content: center;
    }
}

/* Scrollbar Styling */
.chat-body::-webkit-scrollbar {
    width: 8px;
}

.chat-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.chat-body::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.chat-body::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}
