/**
 * Tool Framework CSS
 * 
 * Consistent UI classes for all tools to ensure uniform look and feel
 * Use these classes when building your tools for consistent styling
 * 
 * @package ToolHub
 * @since 1.0.0
 */

/* ==========================================================================
   TOOL WRAPPER & LAYOUT
   ========================================================================== */

/**
 * Main container for any tool
 * Usage: <div class="tool-wrapper">...</div>
 */
.tool-wrapper {
    background: #ffffff;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.tool-wrapper--bordered {
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tool-wrapper--two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .tool-wrapper--two-column {
        grid-template-columns: 1fr;
    }
}

/* Tool Header */
.tool-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.tool-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
}

/* Tool Body */
.tool-body {
    padding: 0;
}

/* ==========================================================================
   FORM ELEMENTS
   ========================================================================== */

/**
 * Form container
 * Usage: <form class="tool-form">...</form>
 */
.tool-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Field Groups */
.tool-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tool-field-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Inputs */
.tool-field-input {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.tool-field-input:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.tool-field-input::placeholder {
    color: #9ca3af;
}

/* Select */
.tool-field-select {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    background-color: #ffffff;
    cursor: pointer;
    transition: border-color 0.2s;
}

.tool-field-select:focus {
    outline: none;
    border-color: #0066cc;
}

/* Textarea */
.tool-field-textarea {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.tool-field-textarea:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* Inline inputs */
.tool-inline-inputs {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.tool-inline-inputs .tool-field {
    flex: 1;
    min-width: 200px;
}

/* Grid layouts for inputs */
.tool-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.tool-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {

    .tool-grid-2,
    .tool-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   BUTTONS & ACTIONS
   ========================================================================== */

/**
 * Action buttons container
 * Usage: <div class="tool-actions">...</div>
 */
.tool-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* Primary button */
.tool-button {
    padding: 0.75rem 1.5rem;
    background: #0066cc;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    text-align: center;
}

.tool-button:hover {
    background: #0052a3;
    transform: translateY(-1px);
}

.tool-button:active {
    transform: translateY(0);
}

/* Secondary button */
.tool-button--secondary {
    background: #6c757d;
}

.tool-button--secondary:hover {
    background: #5a6268;
}

/* Success button */
.tool-button--success {
    background: #28a745;
}

.tool-button--success:hover {
    background: #218838;
}

/* Danger button */
.tool-button--danger {
    background: #dc3545;
}

.tool-button--danger:hover {
    background: #c82333;
}

/* Disabled button */
.tool-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.tool-button:disabled:hover {
    background: #0066cc;
}

/* ==========================================================================
   RESULTS & OUTPUT
   ========================================================================== */

/**
 * Result container
 * Usage: <div class="tool-result">...</div>
 */
.tool-result {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 6px;
    border-left: 4px solid #0066cc;
}

.tool-result-highlight {
    font-size: 2rem;
    font-weight: 700;
    color: #0066cc;
    margin: 0.5rem 0;
}

.tool-result-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.25rem;
}

.tool-result-value {
    font-size: 1.125rem;
    color: #1a1a1a;
}

/* ==========================================================================
   NOTIFICATIONS & MESSAGES
   ========================================================================== */

/* Info/Note */
.tool-note {
    padding: 1rem;
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    border-radius: 4px;
    color: #0d47a1;
    margin: 1rem 0;
}

/* Success */
.tool-success {
    padding: 1rem;
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
    border-radius: 4px;
    color: #1b5e20;
    margin: 1rem 0;
}

/* Warning */
.tool-warning {
    padding: 1rem;
    background: #fff3e0;
    border-left: 4px solid #ff9800;
    border-radius: 4px;
    color: #e65100;
    margin: 1rem 0;
}

/* Error */
.tool-error {
    padding: 1rem;
    background: #ffebee;
    border-left: 4px solid #f44336;
    border-radius: 4px;
    color: #b71c1c;
    margin: 1rem 0;
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

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

.tool-text-right {
    text-align: right;
}

.tool-mb-1 {
    margin-bottom: 1rem;
}

.tool-mb-2 {
    margin-bottom: 2rem;
}

.tool-mt-1 {
    margin-top: 1rem;
}

.tool-mt-2 {
    margin-top: 2rem;
}

/* ==========================================================================
   RESPONSIVE TABLE
   ========================================================================== */

.tool-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.tool-table th {
    background: #f3f4f6;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #d1d5db;
}

.tool-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.tool-table tr:hover {
    background: #f9fafb;
}

/* ==========================================================================
   LOADING STATE
   ========================================================================== */

.tool-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f4f6;
    border-top-color: #0066cc;
    border-radius: 50%;
    animation: tool-spin 0.8s linear infinite;
}

@keyframes tool-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   DOCUMENTATION EXAMPLE
   ========================================================================== */

/**
 * Example usage of Tool Framework classes:
 * 
 * <div class="tool-wrapper tool-wrapper--bordered">
 *   <div class="tool-header">
 *     <h3 class="tool-title">BMI Calculator</h3>
 *   </div>
 *   <div class="tool-body">
 *     <form class="tool-form">
 *       <div class="tool-field">
 *         <label class="tool-field-label">Weight (kg)</label>
 *         <input type="number" class="tool-field-input" placeholder="Enter weight">
 *       </div>
 *       <div class="tool-field">
 *         <label class="tool-field-label">Height (cm)</label>
 *         <input type="number" class="tool-field-input" placeholder="Enter height">
 *       </div>
 *       <div class="tool-actions">
 *         <button type="button" class="tool-button">Calculate BMI</button>
 *       </div>
 *     </form>
 *     <div class="tool-result" id="result" style="display:none;">
 *       <div class="tool-result-label">Your BMI:</div>
 *       <div class="tool-result-highlight" id="bmi-value">0.00</div>
 *     </div>
 *   </div>
 * </div>
 */