/* Audio Chat Styles */

/* Container principale */
.audio-chat-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-top: 2rem;
    color: white;
}

.audio-chat-container h2 {
    color: white;
    text-align: center;
    margin-bottom: 1rem;
    font-size: 2rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.audio-chat-container p {
    text-align: center;
    opacity: 0.9;
    margin-bottom: 2rem;
}

/* Controlli chiamata */
.call-controls {
    display: flex;
    gap: 1.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.call-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.call-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.call-btn:hover::before {
    width: 100%;
    height: 100%;
}

.call-btn.primary {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    animation: pulse 2s infinite;
}

.call-btn.primary:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

.call-btn.danger {
    background: linear-gradient(135deg, #dc3545, #e74c3c);
    color: white;
}

.call-btn.danger:hover {
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.4);
}

.call-btn.secondary {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
}

.call-btn.secondary:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(108, 117, 125, 0.4);
}

.call-btn.secondary.active {
    background: linear-gradient(135deg, #dc3545, #e74c3c);
    animation: shake 0.5s ease-in-out;
}

/* Animazioni */
@keyframes pulse {
    0% {
        box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(40, 167, 69, 0.6);
    }
    100% {
        box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

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

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* Status chiamata */
.call-status {
    text-align: center;
    margin: 2rem 0;
    padding: 1.5rem;
    border-radius: 15px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    animation: fadeIn 0.5s ease-out;
}

.call-status i {
    margin-right: 0.5rem;
    animation: blink 1.5s infinite;
}

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

/* Timer chiamata */
.call-timer {
    font-size: 2.5rem;
    font-weight: bold;
    color: #28a745;
    margin: 1.5rem 0;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    animation: fadeIn 0.5s ease-out;
}

/* Visualizzatore audio */
.audio-visualizer {
    width: 100%;
    height: 120px;
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    border-radius: 15px;
    margin: 2rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 4px 15px rgba(0,0,0,0.3);
}

.audio-visualizer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.audio-visualizer canvas {
    border-radius: 10px;
    z-index: 1;
    position: relative;
}

.audio-visualizer i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
    z-index: 1;
    position: relative;
}

.audio-visualizer p {
    margin: 0;
    opacity: 0.8;
    z-index: 1;
    position: relative;
}

/* Controlli volume */
.volume-controls {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    padding: 1rem;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.volume-controls label {
    color: white;
    font-weight: 500;
    min-width: 60px;
}

.volume-slider {
    width: 150px;
    height: 6px;
    border-radius: 3px;
    background: rgba(255,255,255,0.2);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #28a745;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.volume-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #28a745;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

#volume-value {
    color: white;
    font-weight: 500;
    min-width: 40px;
    text-align: center;
}

/* Messaggi chat */
.chat-messages {
    height: 300px;
    overflow-y: auto;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 15px;
    padding: 1rem;
    margin: 1rem 0;
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

.message {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 10px;
    animation: slideIn 0.3s ease-out;
    position: relative;
}

.message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 10px;
    opacity: 0.1;
    background: linear-gradient(135deg, transparent, rgba(255,255,255,0.1));
}

.message.user {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    margin-left: 20%;
    box-shadow: 0 2px 10px rgba(0, 123, 255, 0.3);
}

.message.other {
    background: linear-gradient(135deg, #e9ecef, #dee2e6);
    color: #333;
    margin-right: 20%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.message.system {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #333;
    text-align: center;
    margin: 0 10%;
    box-shadow: 0 2px 10px rgba(255, 193, 7, 0.3);
}

.message-header {
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
    opacity: 0.8;
    font-weight: 500;
}

.message-content {
    font-weight: 500;
    line-height: 1.4;
}

/* Input messaggi */
.chat-input-container {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

#audio-chat-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 25px;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 1rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

#audio-chat-input::placeholder {
    color: rgba(255,255,255,0.7);
}

#audio-chat-input:focus {
    outline: none;
    border-color: #28a745;
    background: rgba(255,255,255,0.15);
    box-shadow: 0 0 15px rgba(40, 167, 69, 0.3);
}

#send-audio-message {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#send-audio-message:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

/* Informazioni chiamata */
.call-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.info-card {
    background: rgba(255,255,255,0.1);
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease-out;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.info-card i {
    font-size: 2.5rem;
    color: #28a745;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.info-card h4 {
    color: white;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.info-card p {
    color: rgba(255,255,255,0.9);
    margin: 0;
    line-height: 1.4;
}

/* Responsive */
@media (max-width: 768px) {
    .audio-chat-container {
        padding: 1rem;
        margin-top: 1rem;
    }
    
    .call-controls {
        gap: 1rem;
    }
    
    .call-btn {
        width: 70px;
        height: 70px;
        font-size: 1.5rem;
    }
    
    .call-timer {
        font-size: 2rem;
    }
    
    .audio-visualizer {
        height: 100px;
    }
    
    .volume-controls {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .volume-slider {
        width: 120px;
    }
    
    .call-info {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .message.user,
    .message.other {
        margin-left: 5%;
        margin-right: 5%;
    }
    
    .message.system {
        margin: 0 5%;
    }
    
    .audio-chat-container h2 {
        font-size: 1.5rem;
    }
    
    .info-card {
        padding: 1rem;
    }
    
    .info-card i {
        font-size: 2rem;
    }
    
    .info-card h4 {
        font-size: 1rem;
    }
}

/* Stati speciali */
.connecting {
    animation: connecting 1s infinite;
}

@keyframes connecting {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.connected {
    animation: connected 0.5s ease-out;
}

@keyframes connected {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Tema scuro per compatibilità */
@media (prefers-color-scheme: dark) {
    .audio-chat-container {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    }
    
    .info-card {
        background: rgba(0,0,0,0.3);
    }
}

/* Animazioni per notifiche */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 1000;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.notification.error {
    background: linear-gradient(135deg, #dc3545, #e74c3c);
}

.notification.warning {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #333;
}

/* Mobile specific improvements */
@media (max-width: 480px) {
    .audio-chat-container {
        padding: 0.5rem;
        border-radius: 10px;
    }
    
    .call-controls {
        gap: 0.5rem;
    }
    
    .call-btn {
        width: 60px;
        height: 60px;
        font-size: 1.2rem;
    }
    
    .call-timer {
        font-size: 1.5rem;
    }
    
    .audio-visualizer {
        height: 80px;
    }
    
    .volume-controls {
        padding: 0.5rem;
    }
    
    .volume-slider {
        width: 100px;
    }
    
    .chat-messages {
        height: 200px;
    }
    
    .info-card {
        padding: 0.75rem;
    }
    
    .info-card i {
        font-size: 1.5rem;
    }
    
    .info-card h4 {
        font-size: 0.9rem;
    }
    
    .info-card p {
        font-size: 0.8rem;
    }
}

/* Touch improvements for mobile */
@media (hover: none) and (pointer: coarse) {
    .call-btn:hover {
        transform: none;
    }
    
    .call-btn:active {
        transform: scale(0.95);
    }
    
    .info-card:hover {
        transform: none;
    }
    
    .info-card:active {
        transform: scale(0.98);
    }
    
    .volume-slider::-webkit-slider-thumb:hover {
        transform: none;
    }
    
    .volume-slider::-webkit-slider-thumb:active {
        transform: scale(1.1);
    }
} 