* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
    animation: fadeIn 0.5s ease-in;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 30px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.6s ease-out;
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
}

#cityInput {
    padding: 15px 20px;
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    width: 300px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    background: white;
}

#cityInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

#searchBtn {
    padding: 15px 30px;
    font-size: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: pulse 2s infinite;
}

#searchBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

#searchBtn:active {
    transform: translateY(0);
}

.loading {
    text-align: center;
    color: #2c3e50;
    font-size: 1.2rem;
    padding: 20px;
    animation: spin 1s linear infinite;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #667eea;
    border-top-color: transparent;
    border-radius: 50%;
    margin-left: 10px;
    animation: spin 1s linear infinite;
}

.error {
    background: linear-gradient(135deg, #f44336 0%, #e53935 100%);
    color: white;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 20px;
    animation: shake 0.5s ease-in-out;
}

.hidden {
    display: none;
}

.results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.weather-section,
.tide-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 0.6s ease-out;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.weather-section:hover,
.tide-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

.weather-section h2,
.tide-section h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5rem;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.weather-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.main-info {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    color: white;
    animation: scaleIn 0.5s ease-out;
}

.temperature {
    font-size: 4rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.description {
    font-size: 1.5rem;
    margin-bottom: 10px;
    text-transform: capitalize;
}

.city-name {
    font-size: 1.2rem;
    opacity: 0.9;
}

.details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
}

.detail-item:hover {
    background: #e8f4f8;
    transform: scale(1.05);
    border-color: #667eea;
}

.detail-item .label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.detail-item span:last-child {
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
}

.tide-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.current-tide {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.current-tide:hover {
    background: #e8f4f8;
    border-color: #667eea;
}

.current-tide .label {
    font-weight: bold;
    color: #666;
}

.current-tide span:last-child {
    font-size: 1.2rem;
    font-weight: bold;
    color: #667eea;
}

.tide-chart-container {
    position: relative;
    height: 400px;
    width: 100%;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    border: 1px solid #e0e0e0;
}

@media (max-width: 768px) {
    .results {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    #cityInput {
        width: 100%;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .details {
        grid-template-columns: 1fr;
    }
    
    .temperature {
        font-size: 3rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .tide-chart-container {
        height: 300px;
    }
    
    .weather-section,
    .tide-section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }
    
    .temperature {
        font-size: 2.5rem;
    }
    
    .description {
        font-size: 1.2rem;
    }
    
    .tide-chart-container {
        height: 250px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    }
}

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

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}
