/* Additional styles for one-pager tools - UPDATED */

.tool-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 2rem 0;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
}

.tool-controls {
    background-color: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
}

.tool-output {
    background-color: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    width: 100%;
    border: 2px solid var(--accent-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.tool-output h3 {
    color: var(--accent-color);
    margin-top: 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--accent-color);
}

#output {
    position: relative;
}

#output::before {
    content: "";
    position: absolute;
    top: -12px;
    left: 20px;
}

/* Form controls styling to match the theme */
.form-group {
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.full-width {
    width: 100%;
    max-width: 100%;
    display: block;
    box-sizing: border-box;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border-radius: 0.25rem;
    font-family: inherit;
    font-size: 1rem;
    box-sizing: border-box;
}

/* Make CSV input textarea wider and improve formatting */
#csvInput {
    width: 100% !important;
    min-height: 250px;
    font-family: 'Courier New', monospace;
    white-space: pre;
    tab-size: 4;
    -moz-tab-size: 4;
    box-sizing: border-box;
    max-width: 100%;
    resize: vertical;
    overflow-x: auto;
    line-height: 1.5;
    font-size: 14px;
    letter-spacing: -0.2px;
    padding: 12px;
    margin: 0;
    display: block;
    flex: 1 1 auto;
}

/* Fix for textarea width issues */
textarea#csvInput {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    box-sizing: border-box !important;
}

.btn {
    padding: 0.75rem 1.5rem;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s, opacity 0.2s;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

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

.btn:active {
    transform: translateY(1px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Accessibility features */
.btn:focus, .form-control:focus {
    outline: 2px solid var(--focus-outline-color);
    outline-offset: 2px;
}

/* Table styles for data display */
.table-responsive {
    overflow-x: auto;
    max-width: 100%;
    margin-bottom: 2rem;
    border-radius: 0.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tool-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 1.5rem;
    text-align: left;
    border: 1px solid var(--border-color);
    table-layout: auto;
}

.tool-table th,
.tool-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

.tool-table td {
    white-space: pre-wrap;
    word-break: break-word;
}

.tool-table th {
    background-color: var(--accent-color);
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}

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

.tool-table th.sort-asc,
.tool-table th.sort-desc {
    background-color: var(--accent-hover);
}

.tool-table tr:nth-child(even) {
    background-color: var(--bg-tertiary);
}

.tool-table tr:hover {
    background-color: var(--bg-hover);
}

/* File input styling */
.file-input-container {
    position: relative;
    margin-bottom: 1rem;
}

.file-input {
    position: absolute;
    left: -9999px;
}

.file-input-label {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--button-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s;
}

.file-input-label:hover {
    background-color: var(--button-hover-bg);
    border-color: var(--accent-color);
}

.file-name {
    margin-left: 1rem;
    font-style: italic;
}

/* Progress indicators */
.progress-container {
    width: 100%;
    background-color: var(--progress-bg);
    border-radius: 4px;
    margin: 1rem 0;
}

.progress-bar {
    height: 10px;
    background-color: var(--accent-color);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Alert/notification styles */
.alert {
    padding: 1rem 1rem 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 0.25rem;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert::before {
    margin-right: 0.75rem;
    font-size: 1.2rem;
}

.alert-info {
    background-color: rgba(59, 130, 246, 0.1);
    border-left: 4px solid rgb(59, 130, 246);
    color: var(--text-primary);
}

.alert-info::before {
    content: "ℹ️";
}

.alert-success {
    background-color: rgba(34, 197, 94, 0.15);
    border-left: 4px solid rgb(34, 197, 94);
    color: var(--text-primary);
}

.alert-success::before {
    content: "✅";
}

.alert-error {
    background-color: rgba(239, 68, 68, 0.15);
    border-left: 4px solid rgb(239, 68, 68);
    color: var(--text-primary);
}

.alert-error::before {
    content: "⚠️";
}

/* CSV Example Section */
.csv-examples {
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
}

.csv-examples h3 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.csv-examples p {
    margin-bottom: 1rem;
}

.csv-examples button {
    margin-right: 0.75rem;
    margin-top: 0.5rem;
}

/* Checkbox styling */
input[type="checkbox"] {
    width: 1.2rem;
    height: 1.2rem;
    vertical-align: middle;
    margin-left: 0.5rem;
    accent-color: var(--accent-color);
}

/* Section headers */
h2, h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

hr {
    margin: 2.5rem 0;
    border: 0;
    height: 1px;
    background-color: var(--border-color);
}

/* Accessibility styles */
.accessibility-notice {
    font-size: 0.9rem;
    margin-top: 30px;
    padding: 15px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
}

/* Improved responsive design */
@media (max-width: 768px) {
    .tool-container {
        padding: 0;
    }
    
    .tool-controls,
    .tool-output {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .tool-table th,
    .tool-table td {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    #csvInput {
        min-height: 150px;
    }
}

/* Data stats styling */
.data-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: var(--bg-tertiary);
    border-radius: 0.25rem;
    border-left: 4px solid var(--accent-color);
}

.stat-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: var(--bg-primary);
    border-radius: 0.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stat-label {
    font-weight: 600;
    margin-right: 0.5rem;
    color: var(--accent-color);
}

.stat-value {
    font-size: 1.1rem;
    font-weight: bold;
} 