/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #1c4564 0%, #3e7ca9 100%);
    color: #333;
    min-height: 100vh;
    padding: 20px;
}

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(19, 48, 77, 0.12);
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
}

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

/* Header */
header {
    background: linear-gradient(135deg, #13304D 0%, #1a3f5a 100%);
    color: white;
    padding: 40px 20px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Footer */
footer {
    background: #F4F4F4;
    padding: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    border-top: 1px solid #e0e0e0;
}

/* Main Content */
main {
    padding: 40px 20px;
}

section {
    margin-bottom: 40px;
}

section h2 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: #13304D;
    padding-bottom: 10px;
    border-bottom: 3px solid #A4BDD6;
    font-weight: 600;
}

section h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #13304D;
    font-weight: 600;
}

/* Form Section */
.form-section {
    background: #F4F4F4;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    font-weight: 600;
    color: #13304D;
    font-size: 0.95rem;
}

input[type="text"] {
    padding: 12px 15px;
    border: 2px solid #A4BDD6;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
    font-family: 'Poppins', sans-serif;
}

input[type="text"]:focus {
    outline: none;
    border-color: #13304D;
    box-shadow: 0 0 0 3px rgba(19, 48, 77, 0.1);
}

/* Buttons */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Poppins', sans-serif;
}

.btn-primary {
    background: linear-gradient(135deg, #13304D 0%, #1a3f5a 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(19, 48, 77, 0.3);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-secondary {
    background: #A4BDD6;
    color: #13304D;
    margin-top: 20px;
    font-weight: 600;
}

.btn-secondary:hover {
    background: #8fa7c4;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(19, 48, 77, 0.15);
}

.btn-text {
    display: inline;
}

/* Loading Spinner */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner.hidden {
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Results Section */
.results-section {
    display: none;
}

.results-section.show {
    display: block;
    animation: slideIn 0.3s ease-out;
}

.hidden {
    display: none !important;
}

/* Status Card */
.status-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    background: white;
    border: 2px solid #A4BDD6;
}

.status-indicator {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #f0f0f0;
    animation: pulse 2s ease-in-out infinite;
}

.status-card.success .status-indicator {
    background: #4caf50;
}

.status-card.warning .status-indicator {
    background: #ff9800;
}

.status-card.error .status-indicator {
    background: #f44336;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.status-card h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #13304D;
}

.status-card p {
    margin: 5px 0 0 0;
    color: #666;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.metric-card {
    display: grid;
    margin: 5px;
    background: linear-gradient(135deg, #f5f7fa 0%, #A4BDD6 100%);
    padding: 20px;
    border-radius: 20px;
    text-align: center;
    border: 1px solid #A4BDD6;
    transition: transform 0.3s;
}

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(19, 48, 77, 0.12);
}

.metric-card--wide {
    grid-column: 1 / 5;
}

.metric-label {
    display: block;
    font-size: 0.85rem;
    color: #13304D;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.metric-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: #13304D;
}

.metric-value--ip {
    font-size: 1.4rem;
    font-family: 'Courier New', monospace;
}

.metric-unit {
    display: block;
    font-size: 0.8rem;
    color: #999;
    margin-top: 5px;
}

/* Details Box */
.details-box {
    background: #F4F4F4;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #F99BBD;
    margin-bottom: 30px;
}

.details-box p {
    margin: 8px 0;
    font-size: 0.95rem;
    color: #333;
}

code {
    background: #e0e0e0;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #13304D;
}

/* Table */
.table-wrapper {
    margin-bottom: 30px;
    overflow-x: auto;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid #A4BDD6;
    border-radius: 6px;
    overflow: hidden;
}

.results-table thead {
    background: linear-gradient(135deg, #13304D 0%, #1a3f5a 100%);
    color: white;
}

.results-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.results-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
}

.results-table tbody tr:hover {
    background: #F4F4F4;
}

.results-table .status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.results-table .status-badge.success {
    background: #4caf50;
    color: white;
}

.results-table .status-badge.failed {
    background: #f44336;
    color: white;
}

/* Alerts and Messages */
.alert {
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-error {
    background: #ffebee;
    border: 1px solid #f44336;
    color: #c62828;
}

#saveStatus {
    margin-top: 15px;
    padding: 10px;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    min-height: 20px;
}

#saveStatus.success {
    background: #c8e6c9;
    color: #2e7d32;
    border: 1px solid #81c784;
}

#saveStatus.error {
    background: #ffcdd2;
    color: #c62828;
    border: 1px solid #ef5350;
}

/* Error Section */
.error-section {
    display: none;
}

.error-section.show {
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }

    main {
        padding: 20px;
    }

    section h2 {
        font-size: 1.4rem;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .metric-card--wide {
        grid-column: 1 / 3;
    }

    .metric-value {
        font-size: 1.3rem;
    }

    .status-card {
        flex-direction: column;
        text-align: center;
    }

    .form-section {
        padding: 20px;
    }

    .results-table {
        font-size: 0.9rem;
    }

    .results-table th,
    .results-table td {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    header {
        padding: 25px 15px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    main {
        padding: 15px;
    }

    section h2 {
        font-size: 1.2rem;
    }

    section h3 {
        font-size: 1.1rem;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .metric-card--wide {
        grid-column: 1;
    }

    .metric-value {
        font-size: 1.5rem;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    footer {
        padding: 15px;
        font-size: 0.8rem;
    }
}
