* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e0e0e0;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(26, 26, 46, 0.8);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #3a3a5e;
}

.header-buttons {
    display: flex;
    gap: 12px;
}

header h1 {
    font-size: 2.5rem;
    color: #4fc3f7;
    text-shadow: 0 2px 10px rgba(79, 195, 247, 0.3);
}

.refresh-btn, .create-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.create-btn {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.refresh-btn:hover, .create-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.create-btn:hover {
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.6);
}

.refresh-btn:active, .create-btn:active {
    transform: translateY(0);
}

.refresh-btn:disabled, .create-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.apps-count {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(79, 195, 247, 0.1);
    border-left: 4px solid #4fc3f7;
    border-radius: 6px;
}

.apps-count p {
    font-size: 1.1rem;
    color: #4fc3f7;
}

.apps-count strong {
    font-size: 1.3rem;
    color: #81d4fa;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.apps-table {
    width: 100%;
    border-collapse: collapse;
    background: #1e1e3f;
}

.apps-table thead {
    background: linear-gradient(135deg, #2d3561 0%, #3f51b5 100%);
}

.apps-table th {
    padding: 18px;
    text-align: left;
    font-weight: 600;
    font-size: 1rem;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.apps-table tbody tr {
    border-bottom: 1px solid #2a2a4e;
    transition: background 0.2s ease;
}

.apps-table tbody tr:hover {
    background: rgba(79, 195, 247, 0.1);
}

.apps-table td {
    padding: 16px;
    color: #d0d0d0;
}

.app-name {
    font-weight: 600;
    color: #81d4fa;
    font-size: 1.1rem;
}

.app-description {
    color: #b0b0b0;
    font-style: italic;
}

.port-value {
    display: inline-block;
    background: rgba(79, 195, 247, 0.2);
    padding: 4px 12px;
    border-radius: 6px;
    color: #4fc3f7;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.protocol-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.protocol-badge.http {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.protocol-badge.https {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.protocol-badge.tcp {
    background: rgba(156, 39, 176, 0.2);
    color: #9c27b6;
}

.protocol-badge.udp {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.error-message {
    background: rgba(244, 67, 54, 0.1);
    border: 2px solid #f44336;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
}

.error-message h2 {
    color: #f44336;
    margin-bottom: 15px;
}

.error-message p {
    color: #ffcdd2;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.error-hint {
    color: #ffab91;
    font-size: 0.95rem;
    margin-top: 20px;
}

.info-message {
    background: rgba(255, 193, 7, 0.1);
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
}

.info-message p {
    color: #ffc107;
    font-size: 1.2rem;
}

/* Responsive design */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    header h1 {
        font-size: 2rem;
    }

    .apps-table {
        font-size: 0.9rem;
    }

    .apps-table th,
    .apps-table td {
        padding: 10px;
    }

    .app-name {
        font-size: 1rem;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 2px solid #3a3a5e;
}

.modal-header h2 {
    color: #4fc3f7;
    margin: 0;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover,
.close:focus {
    color: #4fc3f7;
}

.modal-body {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #81d4fa;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 12px;
    background: rgba(26, 26, 46, 0.8);
    border: 2px solid #3a3a5e;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #4fc3f7;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 25px;
}

.btn-cancel,
.btn-submit {
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel {
    background: rgba(244, 67, 54, 0.3);
    color: #ffcdd2;
}

.btn-cancel:hover {
    background: rgba(244, 67, 54, 0.5);
}

.btn-submit {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.6);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.result-content {
    text-align: center;
}

.port-display {
    font-size: 4rem;
    font-weight: bold;
    color: #4fc3f7;
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.2) 0%, rgba(81, 212, 250, 0.2) 100%);
    padding: 30px;
    border-radius: 12px;
    margin: 20px 0;
    border: 3px solid #4fc3f7;
    box-shadow: 0 0 30px rgba(79, 195, 247, 0.5);
    font-family: 'Courier New', monospace;
}

.result-description {
    color: #b0b0b0;
    font-size: 1.1rem;
    margin: 20px 0;
}

.result-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 25px;
}

