:root {
    --primary-color: #ff6b35;
    --secondary-color: #1a1a1a;
    --accent-color: #00d4ff;
    --racing-red: #e74c3c;
    --racing-blue: #3498db;
    --text-color: #2c3e50;
    --border-color: #34495e;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-gradient: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    --racing-gradient: linear-gradient(45deg, #ff6b35, #f7931e, #ff6b35);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    color: var(--text-color);
    background: var(--bg-gradient);
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 107, 53, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 212, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.header {
    background: var(--racing-gradient);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.logo {
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-text {
    font-family: 'Arial', sans-serif;
    color: #333;
    margin-left: 10px;
}

.logo-icon {
    font-size: 28px;
}

.ad-banner {
    background: #f0f0f0;
    padding: 10px;
    text-align: center;
    margin: 10px 0;
    border: 1px dashed #ccc;
}

.main-nav {
    display: flex;
    align-items: center;
}

.favorite-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px 10px;
    margin-left: 15px;
    transition: all 0.3s ease;
}

.favorite-btn:hover {
    color: #ffd700;
    transform: scale(1.1);
}

.favorite-btn.active {
    color: #ffd700;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropbtn {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 15px;
    font-size: 16px;
    border: none;
    cursor: pointer;
}

.dropdown-content {
    display: none;
    position: fixed;
    background-color: #fff;
    min-width: 200px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 1000;
    border-radius: 5px;
    padding: 10px 0;
}

.dropdown-content a {
    padding: 8px 15px;
    transition: all 0.2s;
}

.dropdown-content a:hover {
    background-color: var(--primary-color);
    color: white;
}

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
}

.dropdown:hover .dropdown-content {
    display: block;
}

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

.content-ad {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    border: 1px solid #e0e0e0;
}

.ad-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.speed-calculator {
    background: var(--card-gradient);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin: 25px 0;
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
    overflow: hidden;
}

.speed-calculator::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--racing-gradient);
    border-radius: 15px;
    padding: 2px;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    z-index: -1;
}

.section-title {
    font-size: 22px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid #4a8bfc;
}

.input-group {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.input-group label {
    width: 180px;
    font-weight: 500;
    color: #444;
}

.input-group input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    max-width: 200px;
}

.unit {
    margin-left: 10px;
    color: #666;
    width: 50px;
}

button#calculate, .calculate-btn {
    background: var(--racing-gradient);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin: 20px 0;
    transition: all 0.3s ease;
    display: block;
    width: 100%;
    max-width: 300px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.4);
    position: relative;
    overflow: hidden;
}

button#calculate::before, .calculate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

button#calculate:hover, .calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.6);
}

button#calculate:hover::before, .calculate-btn:hover::before {
    left: 100%;
}

.result-box {
    background: var(--card-gradient);
    border-radius: 15px;
    padding: 25px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border: 2px solid var(--accent-color);
    position: relative;
    overflow: hidden;
}

.result-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, var(--accent-color), transparent, var(--accent-color));
    opacity: 0.1;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.1; }
    50% { opacity: 0.3; }
}

.result-box h4 {
    margin: 0;
    margin-right: 10px;
    font-size: 18px;
}

.result-value {
    font-size: 28px;
    font-weight: bold;
    background: var(--racing-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 10px;
    text-shadow: 0 0 20px rgba(255, 107, 53, 0.5);
}

@media (max-width: 768px) {
    .input-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .input-group input {
        max-width: 100%;
        width: 100%;
        margin-top: 5px;
    }
    
    .unit {
        margin-left: 0;
        margin-top: 5px;
    }
}

.calculator-guide {
    margin-top: 40px;
    padding: 25px;
    background: #f9f9f9;
    border-radius: 8px;
}

.calculator-guide h3 {
    color: #4a8bfc;
    margin-bottom: 20px;
}

.formula {
    font-family: monospace;
    background: #f0f8ff;
    padding: 12px 15px;
    border-radius: 5px;
    margin: 15px 0;
    border-left: 4px solid #4a8bfc;
    font-size: 15px;
    line-height: 1.5;
}

.guide-section {
    margin: 25px 0;
}

.guide-section h4 {
    color: #333;
    margin-bottom: 10px;
}

.guide-section ul, .guide-section ol {
    padding-left: 20px;
}

.guide-section li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.example-table {
    margin: 25px 0;
    overflow-x: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.example-table table {
    width: 100%;
    border-collapse: collapse;
}

.example-table th {
    background-color: #4a8bfc;
    color: white;
    padding: 12px 15px;
    text-align: left;
    font-weight: 500;
}

.example-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    color: #444;
}

.example-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.example-table tr:hover {
    background-color: #f0f6ff;
}

.welcome-section {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #4a8bfc;
}

.welcome-section h2 {
    color: #333;
    margin-bottom: 15px;
}

.welcome-section h3 {
    color: #4a8bfc;
    margin: 20px 0 10px;
}

.welcome-section ul {
    padding-left: 20px;
    margin: 15px 0;
}

.welcome-section ul li {
    margin-bottom: 8px;
}

.expert-quote {
    background: #f8fafc;
    border-radius: 8px;
    padding: 25px;
    margin: 30px 0;
    display: flex;
    align-items: flex-start;
    border: 1px solid #e0e8f0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.quote-icon {
    font-size: 24px;
    color: #4a8bfc;
    margin-right: 15px;
}

.quote-text {
    font-size: 18px;
    font-style: italic;
    color: #444;
    line-height: 1.5;
}

.quote-author {
    margin-top: 10px;
    font-weight: 600;
    color: #4a8bfc;
    font-style: normal;
    text-align: right;
}

.compact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}

.compact-links a {
    padding: 10px 15px;
    background: white;
    border-radius: 5px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    white-space: nowrap;
    border: 1px solid #eee;
    transition: all 0.2s;
}

.compact-links a:hover {
    background: #f0f0f0;
    border-color: #ddd;
}

.compact-links i {
    margin-right: 8px;
    color: #4a8bfc;
}

.image-placeholder {
    background: #eee;
    padding: 40px;
    text-align: center;
    margin: 30px 0;
    border-radius: 5px;
    color: #666;
}

.main-ad, .bottom-ad {
    background: #f0f0f0;
    padding: 15px;
    margin: 20px 0;
    text-align: center;
    border: 1px dashed #ccc;
}

.calculator-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
}

.calculator-box {
    width: 180px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    transition: all 0.3s ease;
}

.calculator-box i {
    margin-right: 8px;
    color: var(--primary-color);
    font-size: 16px;
}

.calculator-box h3 {
    font-size: 16px;
    margin-bottom: 8px;
}

.calculator-box p {
    font-size: 13px;
    color: #666;
}

.section-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
}

.ad-title {
    font-weight: bold;
    margin-bottom: 10px;
    color: #555;
}

.calculator-box {
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 15px;
    transition: all 0.3s ease;
}

.calculator-box:hover {
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

.footer {
    background-color: var(--secondary-color);
    padding: 30px 20px;
    color: white;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
    margin-bottom: 20px;
}

.footer-logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
    min-width: 250px;
}

.footer-logo .logo-text {
    font-size: 20px;
    font-weight: bold;
    color: white;
}

.footer-description {
    color: #ccc;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    max-width: 300px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 120px;
}

.footer-links a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent-color);
}

.footer-calculators {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 150px;
}

.footer-calculators h4 {
    color: white;
    margin: 0 0 10px 0;
    font-size: 16px;
}

.footer-calculators a {
    color: #ccc;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-calculators a:hover {
    color: var(--accent-color);
}

.footer-bottom {
    border-top: 1px solid #444;
    padding-top: 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.link-column {
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

a:hover {
    color: #3a7be0;
    text-decoration: none;
}

.link-column a {
    color: var(--text-color);
    margin-bottom: 8px;
}

.link-column a:hover {
    color: var(--primary-color);
}

.calculator-box a {
    color: inherit;
}

.calculator-box a:hover {
    color: inherit;
}

@media (max-width: 768px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .footer-logo {
        min-width: auto;
        width: 100%;
    }
    
    .footer-links,
    .footer-calculators {
        min-width: auto;
        width: 100%;
    }

    .logo-text {
        font-size: 18px;
    }
    
    .compact-links {
        display: none;
    }
}

/* Contact Page Styles */
.contact-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.contact-header i {
    font-size: 24px;
    color: #4a8bfc;
}

.contact-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.contact-email {
    color: #4a8bfc;
    font-weight: 500;
    word-break: break-all;
}

/* Calculator Grid Styles */
.calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.calculator-box {
    background: var(--card-gradient);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transition: all 0.4s ease;
    text-align: center;
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
    overflow: hidden;
}

.calculator-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--racing-gradient);
    border-radius: 15px;
    padding: 2px;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.calculator-box:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0,0,0,0.25);
}

.calculator-box:hover::before {
    opacity: 1;
}

.calculator-box i {
    font-size: 40px;
    background: var(--racing-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 10px rgba(255, 107, 53, 0.3));
}

.calculator-box h3 {
    font-size: 18px;
    margin: 10px 0;
    color: #333;
}

.calculator-box p {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* Tab Button Styles */
.tab-btn {
    background: var(--card-gradient);
    color: var(--text-color);
    border: 2px solid var(--accent-color);
    padding: 12px 25px;
    margin-right: 10px;
    cursor: pointer;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.tab-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--racing-gradient);
    transition: left 0.3s ease;
    z-index: -1;
}

.tab-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.3);
}

.tab-btn.active {
    background: var(--racing-gradient);
    color: white;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.4);
}

.tab-btn.active::before {
    left: 0;
}

/* Calculator Section Styles */
.calculator-section {
    display: none;
}

.calculator-section.active {
    display: block;
}