/* Tools Page Shared Styles */
/* Modern styling for all utility tools */

/* Tool Cards Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.tool-card {
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--color-primary);
}

.tool-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--color-primary);
}

.tool-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
}

.tool-description {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.5;
}

/* Tool Page Layout */
.tool-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.tool-header {
    text-align: center;
    margin-bottom: 3rem;
}

.tool-header h1 {
    font-size: var(--font-size-3xl);
    color: white;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    position: relative;
}

.tool-header h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
}

.tool-header p {
    font-size: var(--font-size-lg);
    color: var(--color-text-secondary);
}

/* Form Styles */
.tool-form {
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: var(--font-size-base);
    font-family: var(--font-family-base);
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* File Upload Styles */
.file-upload {
    border: 2px dashed var(--color-border);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload:hover {
    border-color: var(--color-primary);
    background-color: rgba(79, 70, 229, 0.05);
}

.file-upload.dragover {
    border-color: var(--color-primary);
    background-color: rgba(79, 70, 229, 0.1);
}

.file-upload input[type="file"] {
    display: none;
}

.file-upload-icon {
    font-size: 2rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.file-upload-text {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: var(--font-size-base);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-family-base);
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--color-bg-secondary);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background-color: var(--color-border);
}

.btn-success {
    background-color: var(--color-success);
    color: white;
}

.btn-success:hover {
    background-color: var(--color-accent-dark);
}

.btn-danger {
    background-color: var(--color-danger);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: var(--font-size-lg);
}

.btn-full {
    width: 100%;
}

/* Result Display */
.result-section {
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.result-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: white;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    padding: 1rem 1.5rem;
    margin: -2rem -2rem 1rem -2rem;
    border-radius: 8px 8px 0 0;
    position: relative;
}

.result-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
}

.result-content {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.result-highlight {
    background-color: rgba(16, 185, 129, 0.1);
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid var(--color-success);
    margin: 1rem 0;
}

/* Loading States */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
}

/* Dynamic Sections */
.dynamic-section {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: var(--color-bg-secondary);
}

.dynamic-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.dynamic-section-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    padding: 0.75rem 1rem;
    margin: -1rem -1rem 1rem -1rem;
    border-radius: 6px 6px 0 0;
    position: relative;
}

.dynamic-section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
}

.remove-section {
    background-color: var(--color-danger);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: var(--font-size-xs);
    cursor: pointer;
}

.add-section {
    background-color: var(--color-success);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: var(--font-size-sm);
    cursor: pointer;
    margin-bottom: 1rem;
}

/* Preview Styles */
.preview-container {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1rem;
    background-color: var(--color-bg-secondary);
    margin-top: 1rem;
}

.preview-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: white;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    padding: 0.75rem 1rem;
    margin: -1rem -1rem 1rem -1rem;
    border-radius: 6px 6px 0 0;
    position: relative;
}

.preview-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
}

.preview-content {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .tool-page {
        padding: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .tool-card {
        padding: 1.5rem;
    }
    
    .tool-icon {
        font-size: 2.5rem;
    }
    
    .tool-header h1 {
        padding: 0.75rem 1rem;
        font-size: var(--font-size-2xl);
    }
    
    .result-title {
        padding: 0.75rem 1rem;
        margin: -2rem -2rem 1rem -2rem;
        font-size: var(--font-size-lg);
    }
    
    .preview-title {
        padding: 0.5rem 0.75rem;
        margin: -1rem -1rem 1rem -1rem;
        font-size: var(--font-size-base);
    }
    
    .dynamic-section-title {
        padding: 0.5rem 0.75rem;
        margin: -1rem -1rem 1rem -1rem;
        font-size: var(--font-size-base);
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden { display: none; }
.visible { display: block; }

/* Success/Error Messages */
.message {
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
    font-size: var(--font-size-sm);
}

.message-success {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--color-success);
    color: var(--color-accent-dark);
}

.message-error {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--color-danger);
    color: #dc2626;
}

.message-info {
    background-color: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--color-info);
    color: #4f46e5;
}
