* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a2e;
    color: #eee;
    min-height: 100vh;
    padding: 20px;
    font-size: 16px;
}
.header {
    text-align: center;
    margin-bottom: 30px;
}
.header h1 {
    color: #00d4ff;
    font-size: 2.5em;
    margin-bottom: 5px;
}
.header .subtitle {
    color: #888;
    font-size: 1.1em;
}
.last-update {
    color: #666;
    font-size: 1em;
    margin-top: 10px;
}
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.status-card {
    background: #16213e;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #0f3460;
    transition: transform 0.2s;
}
.status-card:hover {
    transform: translateY(-2px);
}
.status-card h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 1.1em;
}
.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}
.status-indicator.running {
    background: #00ff88;
    box-shadow: 0 0 10px #00ff88;
}
.status-indicator.stopped {
    background: #ff4757;
    box-shadow: 0 0 10px #ff4757;
    animation: none;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.status-details {
    font-size: 1em;
    color: #aaa;
}
.status-details p {
    margin: 5px 0;
}
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: bold;
    text-transform: uppercase;
}
.status-badge.running {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
}
.status-badge.stopped {
    background: rgba(255, 71, 87, 0.2);
    color: #ff4757;
}
.control-buttons {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.2s;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.btn-start {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
    border: 1px solid #00ff88;
}
.btn-start:hover:not(:disabled) {
    background: rgba(0, 255, 136, 0.3);
}
.btn-stop {
    background: rgba(255, 71, 87, 0.2);
    color: #ff4757;
    border: 1px solid #ff4757;
}
.btn-stop:hover:not(:disabled) {
    background: rgba(255, 71, 87, 0.3);
}
.btn-reload {
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
    border: 1px solid #00d4ff;
}
.btn-reload:hover:not(:disabled) {
    background: rgba(0, 212, 255, 0.3);
}
.terminals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}
.terminal {
    background: #0d1117;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #30363d;
}
.terminal-header {
    background: #161b22;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #30363d;
}
.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.terminal-dot.red { background: #ff5f56; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green { background: #27ca40; }
.terminal-title {
    margin-left: 10px;
    font-size: 0.85em;
    color: #8b949e;
}
.terminal-content {
    padding: 15px;
    height: 300px;
    overflow-y: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.8em;
    line-height: 1.6;
}
.terminal-content::-webkit-scrollbar {
    width: 8px;
}
.terminal-content::-webkit-scrollbar-track {
    background: #0d1117;
}
.terminal-content::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 4px;
}
.log-line {
    color: #c9d1d9;
    word-break: break-all;
}
.log-line .timestamp {
    color: #6e7681;
}
.log-line.info { color: #58a6ff; }
.log-line.success { color: #3fb950; }
.log-line.error { color: #f85149; }
.log-line.warn { color: #d29922; }
.empty-logs {
    color: #6e7681;
    font-style: italic;
}
.refresh-info {
    text-align: center;
    margin-top: 20px;
    color: #666;
    font-size: 0.8em;
}
.architecture {
    background: #16213e;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid #0f3460;
}
.architecture h3 {
    margin-bottom: 15px;
    color: #00d4ff;
}
.architecture pre {
    font-family: 'Consolas', monospace;
    font-size: 0.75em;
    color: #8b949e;
    overflow-x: auto;
}
.infobip-config {
    background: #16213e;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid #0f3460;
}
.config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.config-header h3 {
    color: #00d4ff;
    margin: 0;
}
.config-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1em;
}
.config-table th,
.config-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #0f3460;
}
.config-table th {
    background: #0f3460;
    color: #00d4ff;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9em;
}
.config-table td {
    color: #aaa;
    font-size: 1em;
}
.config-table tr:hover td {
    background: rgba(0, 212, 255, 0.05);
}
.config-table .loading {
    text-align: center;
    color: #666;
    font-style: italic;
    font-size: 1em;
}
.config-table td:first-child {
    font-family: 'Consolas', monospace;
    font-size: 0.95em;
    color: #888;
}
.config-table td:nth-child(4) {
    color: #00ff88;
    font-family: 'Consolas', monospace;
    font-size: 1em;
}
/* Call Logs Table Styles */
.call-logs-section {
    background: #16213e;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid #0f3460;
}
.call-logs-table td {
    font-size: 0.85em;
    padding: 8px 10px;
}
.call-logs-table th {
    font-size: 0.85em;
    padding: 10px;
}
.call-logs-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}
.call-logs-table th.sortable:hover {
    background: rgba(0, 212, 255, 0.2);
}
.call-logs-table th.sortable.active-asc::after {
    content: ' ▲';
    color: #00d4ff;
}
.call-logs-table th.sortable.active-desc::after {
    content: ' ▼';
    color: #00d4ff;
}
.call-logs-table .state-finished { color: #888; }
.call-logs-table .state-established { color: #00ff88; }
.call-logs-table .state-calling { color: #ffbd2e; }
.call-logs-table .state-failed { color: #ff4757; }
.call-logs-table .state-busy { color: #ff9f43; }
.call-logs-table .state-no_answer { color: #feca57; }
.call-logs-table .state-cancelled { color: #888; }
.call-logs-table .dir-inbound { color: #00d4ff; }
.call-logs-table .dir-outbound { color: #a29bfe; }
.call-logs-table .callid-cell {
    font-family: 'Consolas', monospace;
    font-size: 0.75em;
    color: #888;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}
.call-logs-table .callid-cell:hover {
    color: #00d4ff;
}
.logs-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}
#logsSearch {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #0f3460;
    background: #0d1117;
    color: #fff;
    font-size: 0.9em;
    width: 300px;
}
#logsSearch:focus {
    outline: none;
    border-color: #00d4ff;
}
.paging-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #0f3460;
}
.btn-page {
    padding: 8px 16px;
    font-size: 0.85em;
}
.btn-page:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
#pageInfo {
    color: #aaa;
    font-size: 0.9em;
}
/* Dial Pad Styles */
.dialpad-section {
    background: #16213e;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid #0f3460;
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
}
.dialpad-section h3 {
    color: #00d4ff;
    margin-bottom: 15px;
    font-size: 1.1em;
    text-align: center;
}
.dialpad-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.dialpad-left {
    width: 100%;
}
.dialpad-right {
    width: 100%;
}
.form-group {
    margin-bottom: 12px;
}
.form-group label {
    display: block;
    color: #aaa;
    margin-bottom: 6px;
    font-size: 0.85em;
}
.form-group select,
.form-group input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #0f3460;
    background: #0d1117;
    color: #fff;
    font-size: 1em;
    font-family: 'Consolas', monospace;
    box-sizing: border-box;
}
.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: #00d4ff;
}
.dialpad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}
.dial-btn {
    padding: 14px 10px;
    font-size: 1.2em;
    border: none;
    border-radius: 8px;
    background: #0f3460;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: bold;
}
.dial-btn:hover {
    background: #1a4a7a;
    transform: scale(1.05);
}
.dial-btn:active {
    transform: scale(0.95);
}
.dial-btn.call-btn {
    background: #00ff88;
    color: #000;
    grid-column: span 2;
    font-size: 1em;
}
.dial-btn.call-btn:hover {
    background: #00cc6a;
}
.dial-btn.call-btn:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
}
.dial-btn.hangup-btn {
    background: #ff4757;
    color: #fff;
}
.dial-btn.hangup-btn:hover {
    background: #cc3a47;
}
.dial-btn.hangup-btn:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
}
.copy-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.9em;
    padding: 2px 6px;
    margin-left: 5px;
    border-radius: 4px;
    opacity: 0.7;
    transition: all 0.2s;
}
.copy-btn:hover {
    opacity: 1;
    background: #30363d;
}
.call-status {
    background: #0d1117;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #30363d;
}
.call-status h4 {
    color: #00d4ff;
    margin-bottom: 10px;
    font-size: 0.9em;
}
.status-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #30363d;
    font-size: 0.8em;
}
.status-item:last-child {
    border-bottom: none;
}
.status-item .label {
    color: #888;
}
.status-item .value {
    color: #fff;
    font-family: 'Consolas', monospace;
    font-size: 0.85em;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.status-item .value.calling {
    color: #ffbd2e;
}
.status-item .value.established {
    color: #00ff88;
}
.status-item .value.failed {
    color: #ff4757;
}
.status-item .value.finished {
    color: #888;
}
/* Call Details Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.2s;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.modal-content {
    background: #16213e;
    margin: 5% auto;
    padding: 0;
    border: 1px solid #00d4ff;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideIn 0.3s;
}
@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.modal-header {
    background: #0f3460;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #00d4ff;
}
.modal-header h3 {
    color: #00d4ff;
    margin: 0;
    font-size: 1.3em;
}
.modal-close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}
.modal-close:hover {
    color: #ff4757;
}
.modal-body {
    padding: 20px;
}
.detail-section {
    margin-bottom: 20px;
}
.detail-section h4 {
    color: #00d4ff;
    margin-bottom: 10px;
    font-size: 1em;
    border-bottom: 1px solid #0f3460;
    padding-bottom: 5px;
}
.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #0f3460;
}
.detail-row:last-child {
    border-bottom: none;
}
.detail-label {
    color: #888;
    font-weight: 600;
}
.detail-value {
    color: #fff;
    font-family: 'Consolas', monospace;
    font-size: 0.9em;
}
.detail-value.success {
    color: #00ff88;
}
.detail-value.error {
    color: #ff4757;
}
.detail-value.warning {
    color: #ffbd2e;
}
.call-logs-table tbody tr {
    cursor: pointer;
    transition: background 0.2s;
}
.call-logs-table tbody tr:hover {
    background: rgba(0, 212, 255, 0.1);
}
