/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    color: #333;
}

wrap {
    display: block;
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
    margin-bottom: 20px;
    overflow: hidden;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
    margin-top: 20px;
    margin-bottom: 20px;
    overflow: hidden;
}

/* Header Styles */
header {
    background-color: #4A5568;
    color: white;
    padding: 20px;
    text-align: center;
}

header h1 {
    color: white;
    margin: 0;
    padding: 0;
    border: none;
    text-align: center;
}

.intro-text {
    font-size: 16px;
    color: #f0f0f0;
    margin: 10px 0 0;
    line-height: 1.5;
}

/* Navigation Styles */
nav {
    background-color: #2D3748;
    padding: 0;
}

.main-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-nav li {
    margin: 0;
}

.main-nav a {
    color: white;
    text-decoration: none;
    padding: 12px 20px;
    display: block;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.main-nav a:hover, .main-nav a.active {
    background-color: #4A5568;
    border-bottom: 3px solid #63B3ED;
}

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

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
}

h2 {
    text-align: center;
    color: #4A5568;
    margin-top: 25px;
    margin-bottom: 20px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

input, select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

/* Tab Styles */
.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    margin-right: 5px;
}

.tab.active {
    background-color: #fff;
    border-bottom: 1px solid #fff;
    margin-bottom: -1px;
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Results Styles */
.result {
    margin-top: 30px;
    padding: 15px;
    background-color: #f0f8ff;
    border-radius: 4px;
    border-left: 4px solid #4A5568;
}

.reverse-result {
    margin-top: 20px;
    font-size: 18px;
    font-weight: 600;
    color: #4A5568;
    text-align: center;
    padding: 15px;
    background-color: #f0f8ff;
    border-radius: 4px;
    border-left: 4px solid #4A5568;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

th, td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
}

tr:hover {
    background-color: #f1f1f1;
}

/* Explanation Section Styles */
.explanation {
    margin-top: 30px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 4px;
    border-left: 2px solid #aaa;
}

.explanation h3 {
    margin-top: 0;
    color: #4A5568;
}

.explanation p {
    font-size: 14px;
    margin-bottom: 10px;
}

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

.explanation li {
    margin-bottom: 5px;
}

/* Footer Styles */
footer {
    background-color: #4A5568;
    color: #f0f0f0;
    padding: 20px;
    text-align: center;
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
}

.footer-nav {
    margin-bottom: 15px;
}

.footer-nav a {
    color: #f0f0f0;
    text-decoration: none;
    margin: 0 10px;
}

.footer-nav a:hover {
    text-decoration: underline;
}

footer p {
    margin: 5px 0;
    font-size: 14px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    wrap, .container {
        max-width: 95%;
        margin-top: 10px;
    }

    h1 {
        font-size: 24px;
    }
    
    .main-nav {
        flex-wrap: wrap;
    }
    
    .main-nav li {
        flex: 1 0 50%;
        text-align: center;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab {
        margin-bottom: 5px;
        border-radius: 4px;
        border-bottom: 1px solid #ddd;
    }
    
    .tab.active {
        border-bottom: 1px solid #63B3ED;
    }
}