/* Base styles */
:root {
    --primary-color: #007a55;
    --complementary-color: #ffa500;
    --success-color: #28a745;
    --error-color: #dc3545;
    --text-color: #333;
    --bg-color: #f8f9fa;
    --border-color: #dee2e6;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
}

li {
    list-style: none;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

hr {
    border: 1px solid var(--primary-color);
}

.ruler {
    border: 1px solid var(--bg-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: white;
}

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

.btn-complementary {
    background-color: var(--complementary-color);
    color: #003d27;
}

.btn-complementary:hover {
    background-color: #ff6b96;
}

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

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

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

.btn-sm {
    padding: 0 1rem;
    font-size: 0.875rem;
    height: 32px;
    min-width: 80px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

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

.table th,
.table td {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

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

.table tr:nth-child(even) {
    background-color: #f2f2f2;
}

/* Cards */
.card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.card-title {
    margin-top: 0;
    color: var(--primary-color);
}

/* Result cards */

.constraints-sec {
    display: flex;
    gap: 20px;
}

.results-con {
    flex: 3;
}

.constraints-con {
    flex:1;
    text-align: center;
}

.constraints-input input {
    font-size: 16px;
    width: 5rem;
    border: none;
    border-bottom: 2px solid var(--primary-color);
    border-radius: 0;
}

/* Messages */
.flash-message {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
}

.flash-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flash-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Flash Modal Styles */
.flash-modal-content {
    max-width: 500px;
    margin: 15% auto;
}

.flash-modal-content .modal-body {
    padding: 1.5rem;
}

.flash-modal-content .flash-message {
    margin: 0;
    text-align: center;
    font-size: 1.1rem;
}

/* Sections */
.section {
    margin-bottom: 2rem;
}

/* Section title */
.section-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color, #007a55);
    margin-bottom: 5px;
}

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

/* File controls consistency */
.file-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filename-input {
    width: 180px;
    height: 32px;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    margin: 0;
}

.button-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    height: 32px;
}

.inline-form {
    margin: 0;
    height: 32px;
    display: inline-flex;
}

.hidden-file-input {
    display: none;
}

.upload-btn {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    margin: 0;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.close {
    font-size: 1.5rem;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    padding: 0.5rem;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 1rem;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.btn-secondary {
    background-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.checkbox-group input[type="checkbox"] {
    margin: 0;
}

/* Table actions */
.table-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.table-actions-cell {
    padding: 0.5rem !important;
    text-align: center !important;
    white-space: nowrap;
}

.table-actions-cell .btn {
    margin: 0;
}

.table-actions-cell .button-group {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.table-actions-cell .btn-sm {
    padding: 0.25rem 0.75rem;
    min-width: 70px;
    height: 28px;
}

.table-actions-cell form {
    margin: 0;
    padding: 0;
    height: 28px;
}

/* Form in modal */
.modal .form-group {
    margin-bottom: 0;
}

.modal .form-control {
    margin-bottom: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .file-controls {
        width: 100%;
        justify-content: flex-start;
    }

    .filename-input {
        width: 100%;
    }

    .button-group {
        width: 100%;
        justify-content: flex-start;
    }

    .modal-content {
        margin: 10% auto;
        width: 95%;
    }

    #con-sec {
        display: block;
    }

    .side-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: auto;
        margin-bottom: 1rem;
        z-index: 100;
    }

    .container {
        margin-left: 0;
        max-width: 100%;
    }
}

#con-sec {
    display: flex;
    min-height: calc(100vh - 40px);
}

.side-nav {
    flex: 0 0 250px;
    background: var(--primary-color);
    border-radius: 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: auto;
    min-height: 100vh;
}

.side-nav nav {
    padding: 0 1rem 1rem 1rem;
}

.side-nav h3 {
    color: var(--bg-color);
    font-size: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding: 0 1rem;
}

.side-nav ul {
    padding: 0;
    margin: 0;
}

.side-nav li {
    margin-bottom: 0.5rem;
}

.side-nav a {
    color: var(--bg-color);
    display: block;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.side-nav a:hover {
    color: var(--primary-color);
    background-color: var(--bg-color);
}

.container {
    flex: 1;
    margin-left: 250px;
    max-width: calc(100% - 200px);
    padding: 20px;
}

.total {
    display: flex;
}

.total span {
    flex: 1;
    color: white;
    text-align: left;
    background: var(--primary-color);
    border: 1px solid var(--border-color);
    padding: 0.75rem;
}

/* Export Modal Styles */
.export-modal-content {
    max-width: 450px;
    margin: 10% auto;
}

.export-modal-content .modal-body {
    padding: 1.5rem;
}

.export-modal-content .form-group {
    margin-bottom: 1.25rem;
}

.export-modal-content .form-group:last-child {
    margin-bottom: 0;
}

.export-modal-content label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.export-modal-content small {
    display: block;
    color: #666;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.export-modal-content .form-control {
    margin-bottom: 0;
}

.export-modal-content .modal-footer {
    padding: 1rem 1.5rem;
}

/* Lucide Icons */
[data-lucide] {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    margin-right: 0.35em;
    margin-left: 0.15em;
}

.side-nav [data-lucide] {
    color: inherit;
}

.btn [data-lucide] {
    width: 1.1em;
    height: 1.1em;
    margin-right: 0.4em;
    margin-left: 0;
}

.table-actions-cell [data-lucide] {
    width: 1em;
    height: 1em;
    margin-right: 0.25em;
}