/* ========================================================================== */
/* GeoNames API Integration Task - Stylesheet */
/* ========================================================================== */

/* ========================================================================== */
/* CSS Variables */
/* ========================================================================== */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-bg: #ecf0f1;
}

/* ========================================================================== */
/* Base Styles */
/* ========================================================================== */

body {
    background: linear-gradient(135deg, var(--light-bg) 0%, #bdc3c7 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ========================================================================== */
/* Main Container */
/* ========================================================================== */

.main-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    margin: 20px auto;
    overflow: hidden;
}

/* ========================================================================== */
/* Header Section */
/* ========================================================================== */

.header-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.header-section h1 {
    margin: 0;
    font-weight: 300;
    font-size: 2.5rem;
}

.header-section p {
    margin: 0.5rem 0 0 0;
    opacity: 0.9;
}

/* ========================================================================== */
/* API Sections */
/* ========================================================================== */

.api-section {
    padding: 2rem;
    border-bottom: 1px solid #eee;
}

.api-section:last-child {
    border-bottom: none;
}

.api-card {
    background: #fff;
    border: 2px solid #eee;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.api-card:hover {
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.api-title {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ========================================================================== */
/* Form Elements */
/* ========================================================================== */

.form-label {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.form-control {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 0.75rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

/* ========================================================================== */
/* Result Containers */
/* ========================================================================== */

.result-container {
    background: var(--light-bg);
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    min-height: 60px;
    transition: all 0.3s ease;
}

.result-container.success {
    border-color: var(--success-color);
    background: rgba(39, 174, 96, 0.1);
}

.result-container.error {
    border-color: var(--danger-color);
    background: rgba(231, 76, 60, 0.1);
}

.loading {
    text-align: center;
    color: var(--secondary-color);
}

.loading i {
    animation: spin 1s linear infinite;
}

.result-data {
    background: #fff;
    border-radius: 5px;
    padding: 1rem;
    margin-top: 0.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
}

/* ========================================================================== */
/* Animations */
/* ========================================================================== */

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================================================== */
/* Footer Section */
/* ========================================================================== */

.footer-section {
    background: var(--primary-color);
    color: white;
    text-align: center;
    padding: 1rem;
    font-size: 0.9rem;
}

/* ========================================================================== */
/* Responsive Design */
/* ========================================================================== */

@media (max-width: 768px) {
    .main-container {
        margin: 10px;
    }
    
    .header-section h1 {
        font-size: 2rem;
    }
    
    .api-section {
        padding: 1rem;
    }
}