
/* =========================================================================
 * REUSABLE TOOL STYLES - /studio/assets/css/tools.css
 * Provides a consistent layout and styling for all tool pages.
 * ========================================================================= */

/* --- 1. Tool Page Layout --- */
.tool-page-section {
    padding: 2rem 0;
    background-color: var(--bg-subtle);
    min-height: calc(100vh - var(--header-height) - 100px); /* Adjust 100px based on footer height */
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.tool-container {
    width: 100%;
    max-width: 800px; /* A good width for most tools */
    margin: 0 auto;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    padding: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fade-in-up 0.5s 0.2s forwards cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes fade-in-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* --- 2. Tool Header --- */
.tool-header {
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
}

.tool-header h1 {
    font-size: 2rem;
    color: var(--text-heading);
    margin-bottom: 0.5rem;
}

.tool-header p {
    font-size: 1.1rem;
    color: var(--text-color);
    max-width: 600px;
    margin: 0 auto;
}


/* --- 3. Tool Body & Forms --- */
.tool-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: var(--text-heading);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: var(--font-family-base);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--bg-subtle);
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* --- 4. Tool Actions & Buttons --- */
.tool-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}


/* --- 5. Results Container --- */
.results-container {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    display: none; /* Hidden by default, shown with JS */
    position: relative;
}

.results-container h3 {
    margin-bottom: 1rem;
    text-align: center;
}

/* For pre-formatted text like code snippets */
.results-container pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    background-color: #1e293b; /* Dark background for code */
    color: #e2e8f0;
    padding: 1rem;
    border-radius: var(--border-radius);
    font-family: 'Courier New', Courier, monospace;
}

/* Copy to clipboard button */
.btn-copy {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    background-color: var(--secondary-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

.btn-copy:hover {
    background-color: #111827;
}


/* --- 6. Helper Classes --- */
.alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid transparent;
    margin-bottom: 1.5rem;
    text-align: center;
}

.alert-success {
    background-color: #d1fae5;
    border-color: #6ee7b7;
    color: #065f46;
}

.alert-error {
    background-color: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}


/* --- 7. Media Queries --- */
@media (min-width: 768px) {
    .tool-container {
        padding: 2.5rem;
    }
    
    .tool-header h1 {
        font-size: 2.5rem;
    }
    
    .tool-actions {
        justify-content: flex-end; /* Align buttons to the right on larger screens */
    }
}
