/* integrated-styles.css */
/* Stylesheet for the SIP Tester Application */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    margin: 0;
    padding: 0;
    background-color: #f5f5f7;
}

.header {
    background: linear-gradient(135deg, #1e5799 0%, #207cca 100%);
    color: white;
    padding: 1.5rem;
    text-align: center;
    border-bottom: 4px solid #0a4077;
    position: relative;
}

.header h1 {
    margin: 0;
    font-size: 2rem;
}

/* Language Switcher Styles */
.language-switcher {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    gap: 0.5rem;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.lang-btn.active {
    background: rgba(255, 255, 255, 0.4);
    border-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.lang-btn .flag-icon {
    font-size: 20px;
    line-height: 1;
}

.lang-btn .lang-text {
    font-weight: 600;
}

/* Responsive design for language switcher */
@media (max-width: 768px) {
    .language-switcher {
        position: static;
        margin-top: 1rem;
        justify-content: center;
    }
    
    .lang-btn {
        padding: 0.4rem 0.8rem;
        font-size: 12px;
    }
    
    .lang-btn .flag-icon {
        font-size: 18px;
    }
}

.header h1.aos-init {
    margin: 0;
    padding: 0;
}

.header .img-responsive {
    display: inline-block;
    max-width: 100%;
    height: auto;
}

.header .center-block {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.container {
    max-width: 1200px;
    margin: 1.5rem auto;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h2 {
    color: #1e5799;
    border-bottom: 2px solid #eaeaea;
    padding-bottom: 0.5rem;
    margin-top: 0;
}

.info-box {
    background-color: #e9f7fe;
    border-left: 4px solid #4ac4f3;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
}

.warning-box {
    background-color: #fff8e1;
    border-left: 4px solid #ffca28;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
}

.test-button {
    background-color: #1e5799;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
    margin: 1rem auto;
    display: block;
}

.test-button:hover {
    background-color: #0e4a8b;
}

.test-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.progress {
    display: none;
    margin: 1.5rem 0;
}

.progress-status {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.progress-bar-container {
    width: 100%;
    height: 20px;
    background-color: #eaeaea;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #1e5799 0%, #207cca 100%);
    width: 0%;
    transition: width 0.3s;
}

.log {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    height: 200px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 0.9rem;
    border: 1px solid #eaeaea;
}

.log-item {
    margin-bottom: 0.25rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid #eaeaea;
}

.log-info {
    color: #666;
}

.log-success {
    color: #28a745;
}

.log-warning {
    color: #ffc107;
}

.log-error {
    color: #dc3545;
}

/* Call Section Styles */
.call-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #eaeaea;
}

.media-container {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    margin: 1rem 0;
}

.audio-container {
    flex: 1;
    text-align: center;
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
}

.audio-level {
    height: 100px;
    width: 30px;
    background-color: #eaeaea;
    margin: 0 auto;
    position: relative;
    border-radius: 2px;
    overflow: hidden;
}

.audio-level-fill {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(0deg, #28a745 0%, #a3d39c 100%);
    transition: height 0.1s;
}

.call-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
}

.call-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.start-call {
    background-color: #28a745;
    color: white;
}

.start-call:hover {
    background-color: #218838;
}

.start-call:disabled {
    background-color: #a3d39c;
    cursor: not-allowed;
}

.end-call {
    background-color: #dc3545;
    color: white;
}

.end-call:hover {
    background-color: #c82333;
}

.end-call:disabled {
    background-color: #f5c6cb;
    cursor: not-allowed;
}

/* Results Section Styles */
.results {
    margin-top: 2rem;
    display: none;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eaeaea;
}

th {
    background-color: #f8f9fa;
    font-weight: bold;
}

/* Limit Service column width */
th:first-child,
td:first-child {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-success {
    color: #28a745;
    font-weight: bold;
}

.status-error {
    color: #dc3545;
    font-weight: bold;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.grid-item {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    text-align: center;
}

.grid-item h4 {
    margin-top: 0;
    color: #666;
}

.grid-item p {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0.5rem 0;
    color: #1e5799;
}

/* UDP Port Test Results Styles */
.udp-port-result {
    margin: 10px 0;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fafafa;
    transition: all 0.3s ease;
}

.udp-port-result:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.udp-port-result h4 {
    margin: 0 0 10px 0;
    color: #1e5799;
    font-size: 1.1rem;
}

.udp-port-result .status-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.udp-port-result .status-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.udp-port-result div {
    margin: 5px 0;
    font-size: 0.9rem;
}

.udp-port-result strong {
    color: #333;
}

/* Enhanced status indicators */
.status-success::before {
    content: "✓ ";
}

.status-error::before {
    content: "✗ ";
}

/* Log Export Controls */
.log-export-controls {
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.log-export-controls h3 {
    margin-top: 0;
    color: #333;
}

.export-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.export-button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.export-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.export-button.excel {
    background-color: #217346;
    color: white;
}

.export-button.excel:hover {
    background-color: #1e5e3a;
}

.export-button.pdf {
    background-color: #dc2626;
    color: white;
}

.export-button.pdf:hover {
    background-color: #b91c1c;
}

.export-button.json {
    background-color: #3b82f6;
    color: white;
}

.export-button.json:hover {
    background-color: #2563eb;
}

.export-button.text {
    background-color: #6b7280;
    color: white;
}

.export-button.text:hover {
    background-color: #4b5563;
}

.export-button.html {
    background-color: #f97316;
    color: white;
}

.export-button.html:hover {
    background-color: #ea580c;
}

.export-button.clear {
    background-color: #ef4444;
    color: white;
}

.export-button.clear:hover {
    background-color: #dc2626;
}

/* Main Export Results Button */
#exportResultsBtn {
    background-color: #4CAF50 !important;
    transition: all 0.3s ease;
    font-weight: 600;
}

#exportResultsBtn:hover:not(:disabled) {
    background-color: #45a049 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(76, 175, 80, 0.3);
}

#exportResultsBtn:active:not(:disabled) {
    transform: translateY(0);
}

#exportResultsBtn:disabled {
    background-color: #cccccc !important;
    cursor: not-allowed;
    opacity: 0.6;
}

.export-controls {
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 8px;
    margin-top: 30px;
    text-align: center;
}

.log-stats {
    margin-top: 15px;
    font-size: 14px;
    color: #666;
}

@media (max-width: 768px) {
    .media-container {
        flex-direction: column;
    }

    .grid {
        grid-template-columns: 1fr;
    }
    
    .udp-port-result {
        padding: 10px;
    }
    
    .udp-port-result h4 {
        font-size: 1rem;
    }
}
