/* =====================================
   OsvitaSpace Tools
   Спільні стилі калькуляторів і конвертерів
===================================== */

.trig-tool{
    --tool-accent: #2563eb;
}

.currency-tool{
    --tool-accent: #16a34a;
}

.physics-tool{
    --tool-accent: #ea580c;
}

/* Hero */

.tool-hero{
    background: linear-gradient(135deg, var(--tool-accent), #1e40af);
    color: white;
    text-align: center;
    padding: 60px 20px;
    border-radius: 20px;
    margin-bottom: 40px;
}

.tool-hero h1{
    margin: 0 0 15px;
    font-size: clamp(2rem, 4vw, 3rem);
}

.tool-hero p{
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.1rem;
    opacity: 0.95;
}

/* Контейнер */

.tool-container{
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* Заголовки */

.tool-title{
    text-align: center;
    margin-bottom: 30px;
}

.tool-title h1{
    margin-bottom: 10px;
}

.tool-title p{
    color: #666;
    max-width: 700px;
    margin: 0 auto;
}

/* Перемикач мов */

.language-switcher{
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

#languageSelector{
    padding: 10px 14px;
    border: 1px solid #d9d9d9;
    border-radius: 10px;
    background: #fff;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

#languageSelector:hover{
    border-color: var(--tool-accent);
}

#languageSelector:focus{
    outline: none;
    border-color: var(--tool-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Сітка */

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

/* Картка */

.calculator{
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.calculator h2{
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--tool-accent);
}

/* Поля */

.calculator label{
    display: block;
    margin-top: 14px;
    margin-bottom: 6px;
    font-weight: 600;
}

.calculator input,
.calculator select{
    width: 100%;
    padding: 12px;
    border: 1px solid #d9d9d9;
    border-radius: 10px;
    font-size: 16px;
    box-sizing: border-box;
}

/* Кнопки */

.calculator button{
    width: 100%;
    margin-top: 18px;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: var(--tool-accent);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.calculator button:hover{
    opacity: 0.9;
    transform: translateY(-1px);
}

.button-group{
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.button-group button{
    flex: 1;
    margin-top: 0;
}

.secondary-btn{
    background: #6b7280;
}

.secondary-btn:hover{
    opacity: 0.9;
}

/* Результати */

.results{
    margin-top: 20px;
    padding: 15px;
    background: var(--tool-accent-light);
    border-left: 4px solid var(--tool-accent);
    border-radius: 10px;
    min-height: 40px;
}

/* Довідкові таблиці */

.tool-reference{
    margin: 40px 0;
}

.tool-reference h2{
    color: var(--tool-accent);
    margin-bottom: 20px;
}

.table-wrapper{
    overflow-x: auto;
}

.trig-table{
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.trig-table th{
    background: var(--tool-accent);
    color: white;
}

.trig-table th,
.trig-table td{
    padding: 14px;
    text-align: center;
    border: 1px solid #e5e7eb;
}

.trig-table tr:nth-child(even){
    background: #f8fafc;
}

/* Інформаційний блок */

.tool-info{
    margin-top: 40px;
    padding: 30px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    line-height: 1.7;
}

.tool-info h2{
    margin-top: 0;
    color: var(--tool-accent);
}

.tool-info p{
    text-align: justify;
}

.tool-info ul{
    padding-left: 20px;
}

.tool-info li{
    margin-bottom: 8px;
}

.tool-navigation {
     margin-top: 40px;
    padding: 30px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    line-height: 1.7;
}

.tool-navigation h2 {
    margin-top: 0;
    color: var(--tool-accent);
    text-align: center;
}

.tool-navigation p {
    text-align: center;
}

.tool-navigation a {
    font-weight: 600;
    text-decoration: none;
    text-align: center;
}

/* Адаптація */

@media (max-width: 768px){

    .tool-container{
        padding: 20px 15px;
    }

    .calculator{
        padding: 18px;
    }

    .tool-reference h2, .tool-info h2, 
    .tool-navigation h2, .tool-navigation a{
    text-align: center;
}
}