/* Global Styles */
:root {
    --primary-color: #4a6bff;
    --secondary-color: #6c757d;
    --accent-color: #ff6b6b;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7ff;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.highlight {
    color: var(--primary-color);
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn.primary {
    background-color: var(--primary-color);
    color: white;
}

.btn.primary:hover {
    background-color: #3a5aef;
    transform: translateY(-2px);
}

.btn.secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn.secondary:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

.btn.small {
    padding: 6px 12px;
    font-size: 0.9rem;
}

.text-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.text-link:hover {
    text-decoration: underline;
}

/* Header Styles */
.header {
    background-color: white;
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.8rem;
    color: var(--dark-color);
}

.navbar ul {
    display: flex;
    list-style: none;
}

.navbar ul li {
    margin-left: 20px;
}

.navbar ul li a {
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 600;
    transition: var(--transition);
    padding: 5px 10px;
    border-radius: var(--border-radius);
}

.navbar ul li a:hover, .navbar ul li a.active {
    color: var(--primary-color);
    background-color: rgba(74, 107, 255, 0.1);
}

.mobile-menu {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    padding: 80px 0;
    background: linear-gradient(135deg, #f5f7ff 0%, #e8ecff 100%);
}

.hero .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hero-content {
    flex: 1;
    padding-right: 40px;
}

.hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--dark-color);
}

.hero-content p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    color: var(--secondary-color);
}

.cta-buttons {
    display: flex;
    gap: 15px;
}

.hero-image {
    flex: 1;
    text-align: center;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

/* Calculator Section */
.calculator-section {
    padding: 60px 0;
    background-color: white;
}

.calculator-section h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2rem;
    color: var(--dark-color);
}

.calculator-container {
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 30px;
    max-width: 900px;
    margin: 0 auto;
    transition: var(--transition);
}

.input-section {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 30px;
}

.vector-input {
    flex: 1;
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: var(--border-radius);
}

.vector-input h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.input-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 107, 255, 0.2);
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.result-section h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.result-box {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.steps-box {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: var(--border-radius);
    font-family: 'Courier New', Courier, monospace;
    white-space: pre-wrap;
    line-height: 1.8;
}

/* Info Section */
.info-section {
    padding: 60px 0;
    background-color: #f5f7ff;
}

.info-section h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2rem;
    color: var(--dark-color);
}

.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 30px;
    transition: var(--transition);
    text-align: center;
    position: relative;
    z-index: 1;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.card h3 {
    margin-bottom: 15px;
    color: var(--dark-color);
}

.card p {
    margin-bottom: 20px;
    color: var(--secondary-color);
}

/* Footer Styles */
.footer {
    background-color: var(--dark-color);
    color: white;
    padding: 50px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.footer-section p {
    margin-bottom: 15px;
    opacity: 0.8;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: white;
    opacity: 0.8;
    text-decoration: none;
    transition: var(--transition);
}

.footer-section ul li a:hover {
    opacity: 1;
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.7;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .hero .container {
        flex-direction: column;
    }
    
    .hero-content {
        padding-right: 0;
        margin-bottom: 40px;
        text-align: center;
    }
    
    .cta-buttons {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .navbar {
        display: none;
    }
    
    .mobile-menu {
        display: block;
    }
    
    .input-section {
        flex-direction: column;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .cta-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .hero-image {
        display: none;
    }
}

/* Supporting Page Styles */
.page-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, #3a5aef 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
}

.page-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.page-hero p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.content-section {
    padding: 60px 0;
}

.article-content {
    flex: 2;
    padding-right: 30px;
}

.article-content h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

.article-content p {
    margin-bottom: 20px;
    line-height: 1.8;
}

.article-content ul, .article-content ol {
    margin-left: 30px;
    margin-bottom: 20px;
}

.article-content li {
    margin-bottom: 10px;
}

.math-formula {
    background-color: #f8f9fa;
    border-left: 4px solid var(--primary-color);
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.formula {
    font-size: 1.2rem;
    font-weight: bold;
    margin: 15px 0;
    color: var(--dark-color);
    font-family: 'Courier New', Courier, monospace;
}

.visualization {
    text-align: center;
    margin: 30px 0;
}

.visualization img {
    max-width: 100%;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.caption {
    font-style: italic;
    margin-top: 10px;
    opacity: 0.8;
}

.special-cases {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.case {
    background-color: white;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border-top: 3px solid var(--primary-color);
}

.cta-box {
    background-color: #e8ecff;
    padding: 30px;
    border-radius: var(--border-radius);
    text-align: center;
    margin: 40px 0;
    border-left: 4px solid var(--primary-color);
}

.sidebar {
    flex: 1;
}

.sidebar-widget {
    background-color: white;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 30px;
}

.sidebar-widget h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.sidebar-widget ul {
    list-style: none;
}

.sidebar-widget ul li {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f5f5f5;
}

.sidebar-widget ul li:last-child {
    border-bottom: none;
}

.sidebar-widget ul li a {
    text-decoration: none;
    color: var(--dark-color);
    transition: var(--transition);
    display: block;
}

.sidebar-widget ul li a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.formula-card {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: var(--border-radius);
    text-align: center;
    font-family: 'Courier New', Courier, monospace;
}