:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --secondary: #7209b7;
    --success: #4cc9f0;
    --danger: #f72585;
    --warning: #f8961e;
    --dark: #212529;
    --light: #f8f9fa;
    --gray: #6c757d;
    --border-radius: 12px;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

.dark-mode {
    --primary: #4895ef;
    --primary-dark: #3a7bc8;
    --secondary: #b5179e;
    --success: #4cc9f0;
    --danger: #f72585;
    --warning: #f9c74f;
    --dark: #f8f9fa;
    --light: #121212;
    --gray: #adb5bd;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.6;
    transition: var(--transition);
    min-height: 100vh;
    position: relative;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 2rem 0;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.8rem;
    font-weight: 700;
}

.logo i {
    font-size: 2.2rem;
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(30deg);
}

.search-section {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
}

.dark-mode .search-section {
    background: #1e1e1e;
}

.search-form {
    display: flex;
    gap: 15px;
    margin-bottom: 1.5rem;
}

.search-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.dark-mode .search-input {
    background: #2d2d2d;
    border-color: #444;
    color: var(--dark);
}

.search-input:focus {
    border-color: var(--primary);
    outline: none;
}

.search-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 30px;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover {
    background: var(--primary-dark);
}

.domain-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.action-btn {
    background: var(--light);
    border: 1px solid #e9ecef;
    padding: 8px 15px;
    border-radius: 30px;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.dark-mode .action-btn {
    background: #2d2d2d;
    border-color: #444;
    color: var(--dark);
}

.action-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.results-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .results-section {
        grid-template-columns: 1fr;
    }
}

.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: var(--transition);
}

.dark-mode .card {
    background: #1e1e1e;
}

.card:hover {
    transform: translateY(-5px);
}

.card-header {
    padding: 1.5rem;
    background: var(--primary);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 1.5rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
}

.dark-mode .info-item {
    border-bottom-color: #444;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: var(--gray);
}

.dark-mode .info-label {
    color: #adb5bd;
}

.info-value {
    font-weight: 500;
}

.age-display {
    text-align: center;
    padding: 2rem;
}

.age-number {
    font-size: 4rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 10px;
}

.age-unit {
    font-size: 1.2rem;
    color: var(--gray);
    font-weight: 500;
}

.progress-bar {
    height: 10px;
    background: #e9ecef;
    border-radius: 5px;
    margin: 20px 0;
    overflow: hidden;
}

.dark-mode .progress-bar {
    background: #444;
}

.progress-fill {
    height: 100%;
    background: var(--success);
    border-radius: 5px;
    width: 65%;
}

.comparison-section {
    margin-bottom: 2rem;
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.comparison-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 1.5rem;
    transition: var(--transition);
}

.dark-mode .comparison-card {
    background: #1e1e1e;
}

.comparison-card:hover {
    transform: translateY(-5px);
}

.comparison-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.domain-name {
    font-weight: 700;
    font-size: 1.2rem;
}

.comparison-age {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    text-align: center;
    margin: 1rem 0;
}

footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: var(--dark);
    color: white;
    padding: 2rem 0;
    text-align: center;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    margin-top: 3rem;
}

.dark-mode footer {
    background: #0f0f0f;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: white;
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--success);
}

.loading {
    display: none;
    text-align: center;
    padding: 2rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.dark-mode .loading-spinner {
    border-color: #444;
    border-top-color: var(--primary);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    background: #ffe6e6;
    color: #d00000;
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    display: none;
}

.dark-mode .error-message {
    background: #3a1e1e;
    color: #ff6b6b;
}

.favorite-btn {
    background: transparent;
    border: none;
    color: #ffc107;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.favorite-btn:hover {
    transform: scale(1.2);
}

.favorited {
    color: #ffc107;
}

.history-timeline {
    margin-top: 2rem;
}

.timeline-item {
    display: flex;
    margin-bottom: 1.5rem;
    position: relative;
}

.timeline-item:before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--primary);
}

.timeline-item:last-child:before {
    display: none;
}

.timeline-marker {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-right: 1rem;
    z-index: 1;
}

.timeline-content {
    flex: 1;
    padding-bottom: 1.5rem;
}

.timeline-date {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 5px;
}