/* Tarsyer VPN Dashboard - Coral/Red Theme */
/* Based on surveillance.tarsyer.com design */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #FF6B6B;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* ============================================
   LOGIN PAGE STYLES
   ============================================ */

.login-container {
    background: #fff;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
    width: 100%;
    max-width: 400px;
}

.login-container .logo-container {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-container .logo-container img {
    height: 60px;
    width: auto;
}

.login-container h2 {
    text-align: center;
    color: #1a1a1a;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.login-container .subtitle {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-bottom: 1.5rem;
}

.login-container .form-group {
    margin-bottom: 1rem;
}

.login-container label {
    display: block;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.login-container input[type="text"],
.login-container input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s;
    outline: none;
}

.login-container input[type="text"]:focus,
.login-container input[type="password"]:focus {
    border-color: #E53935;
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.1);
}

.login-container input[type="text"]::placeholder,
.login-container input[type="password"]::placeholder {
    color: #999;
}

.login-container button {
    width: 100%;
    padding: 14px;
    background-color: #E53935;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s;
    margin-top: 0.5rem;
}

.login-container button:hover {
    background-color: #c62828;
}

.login-container button:active {
    transform: scale(0.98);
}

.login-container .error {
    background-color: #ffebee;
    color: #c62828;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    margin-top: 1rem;
    font-size: 14px;
}

/* ============================================
   DASHBOARD PAGE STYLES
   ============================================ */

.dashboard-container {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
    width: 100%;
    max-width: 1400px;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
    border-radius: 16px 16px 0 0;
}

.dashboard-header .logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dashboard-header .logo-section img {
    height: 40px;
    width: auto;
}

.dashboard-header .logo-section h1 {
    color: #1a1a1a;
    font-size: 20px;
    font-weight: 600;
}

.dashboard-header .user-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dashboard-header .user-info {
    color: #666;
    font-size: 14px;
}

#logoutButton {
    padding: 8px 20px;
    background-color: #E53935;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

#logoutButton:hover {
    background-color: #c62828;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    gap: 0;
    padding: 0 2rem;
    border-bottom: 2px solid #f0f0f0;
    background: #fafafa;
}

.tab-btn {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    position: relative;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #E53935;
}

.tab-btn.active {
    color: #E53935;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #E53935;
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 2rem;
    flex: 1;
    overflow: auto;
}

.tab-content.active {
    display: block;
}

/* ============================================
   DEVICES TAB (DataTables)
   ============================================ */

#devicesTable {
    width: 100% !important;
}

#devicesTable thead th {
    background-color: #f8f8f8;
    color: #333;
    font-weight: 600;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 2px solid #e0e0e0;
}

#devicesTable tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    color: #444;
}

#devicesTable tbody tr:hover {
    background-color: #fff5f5;
}

/* DataTables custom styling */
.dataTables_wrapper .dataTables_filter input {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px 12px;
    margin-left: 8px;
    outline: none;
    transition: all 0.2s;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: #E53935;
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.1);
}

.dataTables_wrapper .dataTables_length select {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 6px 10px;
    outline: none;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 6px !important;
    margin: 0 2px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #E53935 !important;
    border-color: #E53935 !important;
    color: white !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #ffebee !important;
    border-color: #E53935 !important;
    color: #E53935 !important;
}

/* ============================================
   INSTALLATION TAB
   ============================================ */

.installation-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    height: 100%;
}

.installation-input-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.installation-input-section h3 {
    color: #1a1a1a;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.installation-input-section p {
    color: #666;
    font-size: 14px;
    margin-bottom: 0.5rem;
}

.serial-input {
    width: 100%;
    height: 200px;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    resize: vertical;
    outline: none;
    transition: all 0.2s;
}

.serial-input:focus {
    border-color: #E53935;
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.1);
}

.serial-input::placeholder {
    color: #999;
}

.btn-primary {
    padding: 12px 24px;
    background-color: #E53935;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover:not(:disabled) {
    background-color: #c62828;
}

.btn-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    padding: 12px 24px;
    background-color: #f0f0f0;
    color: #333;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #e0e0e0;
}

.btn-secondary:disabled {
    color: #999;
    cursor: not-allowed;
}

.button-group {
    display: flex;
    gap: 1rem;
}

/* Queue Status Panel */
.queue-status-panel {
    background: #f8f8f8;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.queue-status-panel h4 {
    color: #1a1a1a;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 1rem;
}

.queue-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.queue-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.queue-item:last-child {
    border-bottom: none;
}

.queue-item .label {
    color: #666;
    font-size: 14px;
}

.queue-item .value {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 14px;
}

.queue-item .value.waiting {
    color: #f57c00;
}

.queue-item .value.running {
    color: #43a047;
}

.queue-item .value.error {
    color: #c62828;
}

.queue-item .value.success {
    color: #2e7d32;
}

.queue-item .value.warning {
    color: #f57c00;
}

/* Installation Logs Section */
.installation-logs-section {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.installation-logs-section h3 {
    color: #1a1a1a;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 1rem;
}

.logs-container {
    flex: 1;
    background: #1a1a1a;
    border-radius: 12px;
    padding: 1rem;
    overflow-y: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.6;
    min-height: 400px;
    max-height: 500px;
}

.log-entry {
    margin-bottom: 4px;
    word-wrap: break-word;
}

.log-entry.info {
    color: #4fc3f7;
}

.log-entry.warn {
    color: #ffb74d;
}

.log-entry.error {
    color: #ef5350;
}

.log-entry.success {
    color: #81c784;
}

.log-entry .timestamp {
    color: #888;
    margin-right: 8px;
}

.log-entry .serial-tag {
    color: #ce93d8;
    margin-right: 8px;
}

/* No logs placeholder */
.logs-placeholder {
    color: #666;
    text-align: center;
    padding: 2rem;
}

/* ============================================
   LOOKUP TAB
   ============================================ */

.lookup-container {
    max-width: 800px;
}

.lookup-container h3 {
    color: #1a1a1a;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.lookup-container p {
    color: #666;
    font-size: 14px;
    margin-bottom: 1rem;
}

.lookup-input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.lookup-results {
    margin-top: 2rem;
}

.lookup-results h4 {
    color: #1a1a1a;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 1rem;
}

.lookup-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.lookup-table thead th {
    background-color: #f8f8f8;
    color: #333;
    font-weight: 600;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 2px solid #e0e0e0;
}

.lookup-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    color: #444;
}

.lookup-table tbody tr:hover {
    background-color: #fff5f5;
}

.lookup-table .ip-found {
    color: #43a047;
    font-weight: 500;
}

.lookup-table .ip-not-found {
    color: #999;
    font-style: italic;
}

/* ============================================
   STATUS BADGES
   ============================================ */

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.active {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.status-badge.expired {
    background-color: #ffebee;
    color: #c62828;
}

.status-badge.pending {
    background-color: #fff3e0;
    color: #ef6c00;
}

/* ============================================
   LOADING SPINNER
   ============================================ */

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

.spinner.dark {
    border-color: #E53935;
    border-top-color: transparent;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1024px) {
    .installation-container {
        grid-template-columns: 1fr;
    }

    .logs-container {
        min-height: 300px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .tab-navigation {
        overflow-x: auto;
        padding: 0 1rem;
    }

    .tab-btn {
        white-space: nowrap;
        padding: 1rem;
    }

    .tab-content {
        padding: 1rem;
    }

    .button-group {
        flex-direction: column;
    }
}
