/* Tools Section */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.tool-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-md);
    transition: var(--transition-smooth);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.tool-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(37, 99, 235, 0.05));
    opacity: 0;
    transition: var(--transition-smooth);
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.tool-card:hover::after {
    opacity: 1;
}

.tool-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    margin-bottom: 20px;
    transition: var(--transition-smooth);
}

.tool-card:hover .tool-icon {
    transform: scale(1.1) rotate(-5deg);
}

.tool-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--darker-color);
    margin-bottom: 10px;
}

.tool-description {
    color: var(--gray-color);
    line-height: 1.6;
    margin-bottom: 20px;
}

.tool-link {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
}

.tool-link:hover {
    gap: 12px;
}

/* Tool Modal/Page */
.tool-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.tool-modal.active {
    display: flex;
}

.tool-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: fadeIn 0.3s ease-out;
}

.tool-modal-header {
    padding: 30px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    position: relative;
}

.tool-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    color: white;
    cursor: pointer;
    background: none;
    border: none;
    transition: var(--transition-smooth);
}

.tool-modal-close:hover {
    transform: scale(1.1);
}

.tool-modal-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.tool-modal-body {
    padding: 30px;
}

.tool-input-group {
    margin-bottom: 25px;
}

.tool-input-group label {
    display: block;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 8px;
}

.tool-input-group input,
.tool-input-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition-smooth);
}

.tool-button {
    padding: 12px 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.tool-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.tool-result {
    margin-top: 30px;
    padding: 25px;
    background: var(--light-color);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.tool-result h3 {
    font-size: 1.5rem;
    color: var(--darker-color);
    margin-bottom: 15px;
}

.result-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin: 15px 0;
}

.result-details {
    color: var(--gray-color);
    line-height: 1.6;
}

/* Calculator Specific */
.calculator-display {
    background: var(--darker-color);
    color: white;
    padding: 20px;
    border-radius: 8px;
    font-size: 2rem;
    text-align: right;
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
}

.calculator-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.calculator-button {
    padding: 20px;
    background: var(--light-color);
    border: none;
    border-radius: 8px;
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.calculator-button:hover {
    background: var(--primary-color);
    color: white;
}

.calculator-button.operator {
    background: var(--primary-color);
    color: white;
}

.calculator-button.operator:hover {
    background: var(--secondary-color);
}

/* Responsive Tools */
@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .tool-modal-content {
        max-width: 100%;
        margin: 10px;
    }
    
    .tool-modal-header,
    .tool-modal-body {
        padding: 20px;
    }
    
    .tool-modal-title {
        font-size: 1.5rem;
    }
    
    .calculator-grid {
        gap: 8px;
    }
    
    .calculator-button {
        padding: 15px;
        font-size: 1.1rem;
    }
}
