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

body {
    font-family: 'Noto Sans SC', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

.navbar {
    background: #1a1a1a;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: #00d4aa;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #667eea;
}

.hero {
    padding: 4rem 0;
    text-align: center;
    color: white;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    font-size: 1.3rem;
    opacity: 0.9;
}

.tools-section {
    padding: 3rem 0 5rem;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    color: white;
    margin-bottom: 3rem;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.tool-card {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    text-decoration: none;
    color: #333;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.tool-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.tool-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.tool-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #667eea;
}

.tool-desc {
    color: #666;
    margin-bottom: 1.5rem;
}

.tool-btn {
    display: inline-block;
    color: #667eea;
    font-weight: 600;
    transition: color 0.3s ease;
}

.tool-card:hover .tool-btn {
    color: #764ba2;
}

.calculator-section {
    padding: 3rem 0 5rem;
}

.page-title {
    text-align: center;
    font-size: 2.5rem;
    color: white;
    margin-bottom: 2rem;
}

.calculator-wrapper {
    display: flex;
    justify-content: center;
}

.calculator {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
}

.display {
    background: #1e3a5f;
    color: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    text-align: right;
}

.display-history {
    font-size: 0.9rem;
    opacity: 0.7;
    min-height: 1.5rem;
}

.display-input {
    font-size: 2rem;
    font-weight: 700;
    word-wrap: break-word;
    word-break: break-all;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.btn {
    padding: 1rem;
    font-size: 1.1rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.btn:hover {
    transform: scale(1.05);
}

.btn:active {
    transform: scale(0.95);
}

.btn-number {
    background: #f0f0f0;
    color: #333;
}

.btn-operator {
    background: #667eea;
    color: white;
}

.btn-function {
    background: #e0e0e0;
    color: #555;
}

.btn-equals {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    grid-column: span 2;
}

.btn-zero {
    grid-column: span 2;
}

.triangle-calculator-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.triangle-form,
.triangle-results {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.form-title {
    font-size: 1.5rem;
    color: #667eea;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.input-group {
    margin-bottom: 1.25rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-variant.hidden {
    display: none;
}

.calculate-btn,
.reset-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-bottom: 0.75rem;
}

.calculate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.reset-btn {
    background: #f0f0f0;
    color: #555;
}

.reset-btn:hover {
    background: #e0e0e0;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.result-item:last-child {
    border-bottom: none;
}

.result-label {
    font-weight: 500;
    color: #555;
}

.result-value {
    font-weight: 600;
    color: #667eea;
}

.result-highlight {
    background: #f8f9ff;
    margin: 0 -2rem;
    padding: 1rem 2rem;
    border-bottom: none;
}

.result-highlight .result-label,
.result-highlight .result-value {
    font-size: 1.1rem;
}

.footer {
    background: #1a1a1a;
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

.footer a {
    color: #00d4aa;
    text-decoration: none;
}

@media (max-width: 768px) {
    .nav-links {
        gap: 1rem;
        font-size: 0.9rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .triangle-calculator-wrapper {
        grid-template-columns: 1fr;
    }
    
    .calculator {
        padding: 1.5rem;
    }
    
    .btn {
        padding: 0.8rem;
        font-size: 1rem;
    }
}