/* Modern CSS Reset and Base Styles */
* {
    box-sizing: border-box;
}

:root {
    --primary-orange: #ff6b35;
    --dark-orange: #e55a2b;
    --light-orange: #ff7d4f;
    --black: #1a1a1a;
    --dark-gray: #2d2d2d;
    --gray: #666666;
    --light-gray: #f5f5f5;
    --white: #ffffff;
    --border-color: #e0e0e0;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--light-gray);
    color: var(--black);
    margin: 0;
    line-height: 1.6;
    font-size: 16px;
}

/* Enhanced Login Container */
div.loginContainer {
    background: var(--white);
    text-align: center;
    margin: 60px auto;
    padding: 40px;
    max-width: 420px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

div.loginContainer:hover {
    box-shadow: var(--shadow-hover);
}

div.loginContainer img {
    max-width: 180px;
    height: auto;
    margin-bottom: 30px;
}

/* Page Title Styling */
div.pageTitle {
    margin: 30px 0;
    padding: 20px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-orange);
}

div.pageTitle h4 {
    color: var(--black);
    font-weight: 600;
    margin: 0;
    font-size: 1.5rem;
}

/* Enhanced Margins */
div.extraMargin {
    margin: 50px 0;
}

/* Modern Border Styling */
div.withborder {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

div.withborder:hover {
    box-shadow: var(--shadow-hover);
}

/* News Image Styling */
img.news {
    width: 100%;
    max-width: 600px;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

img.news:hover {
    transform: scale(1.02);
}

/* OS Section Styling */
div.osGeral {
    min-width: 320px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    overflow: hidden;
}

div.osGeral:hover {
    border-color: var(--primary-orange);
    box-shadow: var(--shadow-hover);
}

/* Table Styling */
table.osTable {
    width: 100%;
    min-width: 250px;
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    table-layout: auto;
}

table.osTable th,
table.osTable td {
    padding: 6px 8px;
    vertical-align: middle;
    word-wrap: break-word;
    font-size: 0.85rem;
}

table.osTable th {
    background: var(--light-gray);
    font-weight: 600;
    font-size: 0.8rem;
}

table.osTable td {
    font-size: 0.75rem;
}

/* Compact buttons for tables */
table.osTable .btn {
    padding: 4px 8px;
    font-size: 0.75rem;
    min-width: auto;
    white-space: nowrap;
}

table.osTable .btn-secondary {
    background: var(--gray);
    border-color: var(--gray);
}

table.osTable .btn-secondary:hover {
    background: var(--dark-gray);
    border-color: var(--dark-gray);
}

/* Responsive table wrapper */
.table-responsive-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    table.osTable {
        min-width: 100%;
        font-size: 0.7rem;
    }
    
    table.osTable th,
    table.osTable td {
        padding: 4px 6px;
        font-size: 0.7rem;
    }
    
    table.osTable .btn {
        padding: 2px 6px;
        font-size: 0.65rem;
    }
}

/* Enhanced Button Styling */
button.options {
    width: 160px;
    height: 60px;
    background: var(--primary-orange);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    margin: 5px;
}

button.options:hover {
    background: var(--dark-orange);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

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

/* Enhanced Form Controls */
.form-control {
    border-radius: 8px;
    border: 2px solid var(--border-color);
    padding: 12px 16px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: var(--white);
    color: var(--black);
}

.form-control:focus {
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
    background: var(--white);
    outline: none;
}

/* Enhanced Buttons */
.btn {
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background: var(--dark-orange);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    color: var(--white);
    text-decoration: none;
}

.btn-primary:disabled {
    background: var(--gray);
    cursor: not-allowed;
    transform: none;
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--dark-gray);
    color: var(--white);
    box-shadow: var(--shadow);
}

.btn-secondary:hover {
    background: var(--black);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    color: var(--white);
    text-decoration: none;
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary-orange);
    border: 2px solid var(--primary-orange);
}

.btn-outline-primary:hover {
    background: var(--primary-orange);
    color: var(--white);
    text-decoration: none;
}

/* Enhanced List Groups */
.list-group {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    background: var(--white);
}

.list-group-item {
    border: none;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
    transition: all 0.3s ease;
    background: var(--white);
    color: var(--black);
}

.list-group-item:hover {
    background: var(--light-gray);
    padding-left: 24px;
}

.list-group-item:last-child {
    border-bottom: none;
}

.list-group-item h5 {
    background: var(--black);
    color: var(--white);
    margin: -16px -20px 16px -20px;
    padding: 20px;
    font-weight: 600;
    font-size: 1.2rem;
}

.list-group-item a {
    color: var(--black);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.list-group-item a:hover {
    color: var(--primary-orange);
    text-decoration: none;
}

/* Enhanced Navbar */
.navbar {
    background: var(--white) !important;
    box-shadow: var(--shadow);
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.navbar-brand img {
    max-height: 45px;
    width: auto;
}

.nav-link {
    font-weight: 500;
    color: var(--black) !important;
    margin: 0 8px;
    padding: 10px 16px !important;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: var(--light-gray);
    color: var(--primary-orange) !important;
}

.nav-link i {
    font-size: 16px;
    margin-right: 6px;
}

/* Form Group Enhancements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    font-weight: 600;
    color: var(--black);
    margin-bottom: 8px;
    display: block;
}

/* Enhanced Select Dropdown Styling */
select.form-control,
.select-custom,
select,
.form-group select,
.container select,
form select {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-color: var(--white) !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6,9 12,15 18,9'></polyline></svg>") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 16px !important;
    padding-right: 40px !important;
    cursor: pointer !important;
    border: 2px solid var(--border-color) !important;
    border-radius: 8px !important;
    padding: 12px 16px !important;
    font-size: 16px !important;
    transition: all 0.3s ease !important;
    color: var(--black) !important;
    z-index: 1000 !important;
    position: relative !important;
    height: auto !important;
    min-height: 48px !important;
}

select.form-control:focus,
.select-custom:focus,
select:focus,
.form-group select:focus,
.container select:focus,
form select:focus {
    border-color: var(--primary-orange) !important;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1) !important;
    background-color: var(--white) !important;
    outline: none !important;
}

/* Force option visibility */
select.form-control option,
.select-custom option,
select option,
.form-group select option,
.container select option,
form select option {
    background-color: var(--white) !important;
    color: var(--black) !important;
    padding: 8px 12px !important;
    border: none !important;
    display: block !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    min-height: 24px !important;
}

/* Force select dropdown to work */
select {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

/* Ensure options are clickable */
select option {
    pointer-events: auto !important;
    cursor: pointer !important;
}

select.form-control option:hover,
.select-custom option:hover,
select option:hover,
.form-group select option:hover,
.container select option:hover,
form select option:hover {
    background-color: var(--light-gray) !important;
    color: var(--black) !important;
}

select.form-control option:checked,
.select-custom option:checked,
select option:checked,
.form-group select option:checked,
.container select option:checked,
form select option:checked {
    background-color: var(--primary-orange) !important;
    color: var(--white) !important;
}

/* Additional override for Bootstrap conflicts */
.bootstrap-select .dropdown-toggle::after {
    display: none !important;
}

.bootstrap-select > .dropdown-toggle {
    background-image: url("data:image/svg+xml;charset=UTF-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6,9 12,15 18,9'></polyline></svg>") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 16px !important;
    padding-right: 40px !important;
}

/* Alert Enhancements */
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: var(--shadow);
    margin: 20px 0;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid var(--primary-orange);
}

/* Container Background */
.container {
    background: var(--white);
    border-radius: 8px;
    padding: 30px;
    margin: 20px auto;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

/* Card Styling */
.card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.card-header {
    background: var(--light-gray);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* Common Layout Classes */
.container-margin-top {
    margin-top: 30px;
}

.container-margin-bottom {
    margin-bottom: 20px;
}

.row-margin-top-35 {
    margin-top: 35px;
}

/* Page Header Component - Reusable */
.page-header {
    background: var(--white);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-orange);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-orange);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.header-icon i {
    font-size: 28px;
    color: var(--white);
}

.header-text h3,
.header-text h4 {
    margin: 0 0 4px 0;
    color: var(--black);
    font-size: 1.75rem;
    font-weight: 600;
}

.header-text p {
    margin: 0;
    color: var(--gray);
    font-size: 1rem;
}

/* Menu Sections Component - Reusable */
.menu-sections {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.menu-section {
    background: var(--white);
    border-radius: 8px;
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.section-header i {
    font-size: 20px;
    color: var(--primary-orange);
}

.section-header h5 {
    margin: 0;
    color: var(--black);
    font-size: 1.25rem;
    font-weight: 600;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 20px;
    background: var(--light-gray);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.menu-item:hover {
    background: var(--white);
    border-color: var(--primary-orange);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    transform: translateY(-2px);
}

.menu-item.featured {
    background: var(--white);
    border-color: var(--primary-orange);
    box-shadow: var(--shadow);
}

.menu-item.featured:hover {
    border-color: var(--dark-orange);
    box-shadow: var(--shadow-hover);
}

.item-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-orange);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.item-icon i {
    font-size: 20px;
    color: var(--white);
}

.item-content h6 {
    margin: 0 0 4px 0;
    color: var(--black);
    font-size: 1rem;
    font-weight: 600;
}

.item-content p {
    margin: 0;
    color: var(--gray);
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Form Components - Reusable */
.form-header {
    background: var(--white);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-orange);
}

.form-container {
    background: var(--white);
    border-radius: 8px;
    padding: 32px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.modern-form .form-group {
    margin-bottom: 24px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--black);
    margin-bottom: 8px;
    font-size: 1rem;
}

.form-label i {
    color: var(--primary-orange);
    font-size: 16px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-start;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.btn-submit, .btn-cancel {
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
    justify-content: center;
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Help Section Component - Reusable */
.help-section {
    margin-top: 24px;
}

.help-card {
    background: var(--light-gray);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.help-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-orange);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.help-icon i {
    font-size: 18px;
    color: var(--white);
}

.help-content h6 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 6px 0;
    color: var(--black);
}

.help-content p {
    margin: 0;
    color: var(--gray);
    line-height: 1.5;
    font-size: 0.875rem;
}

/* Navigation Enhancements */
.nav-link {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.user-info {
    color: var(--black);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: 16px;
}

.user-info i {
    font-size: 18px;
    color: var(--primary-orange);
}

.logout-link {
    color: var(--gray) !important;
}

.logout-link:hover {
    background: var(--light-gray) !important;
    color: var(--black) !important;
}

/* Animation Classes */
.show-animation {
    animation: slideDown 0.3s ease;
}

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

/* Status Colors for Tables */
.status-orange {
    color: orange;
}

.status-green {
    color: green;
}

.status-red {
    color: red;
}

/* Form Inline Display */
.form-inline-display {
    display: inline-block;
    margin-right: 15px;
}

/* Table Utilities */
.table-full-width {
    width: 100%;
}

.table-fixed-layout {
    table-layout: fixed;
}

/* Compact table styling */
.table-compact {
    font-size: 0.875rem;
}

.table-compact th,
.table-compact td {
    padding: 8px 12px;
    vertical-align: middle;
}

.table-compact th {
    font-size: 0.8rem;
    font-weight: 600;
    background-color: var(--light-gray);
}

.table-compact .btn {
    padding: 4px 12px;
    font-size: 0.75rem;
}

/* Search and pagination alignment */
.form-inline .form-control {
    margin-right: 0;
}

.form-inline .input-group {
    width: 100%;
    max-width: 400px;
}

.form-inline .mr-2 {
    white-space: nowrap;
}

/* Word Wrap for Tables */
.word-wrap-break {
    word-wrap: break-all;
}

.word-wrap-break-word {
    word-wrap: break-word;
}

/* Form Inline No Margin */
.form-inline-no-margin {
    margin: 0;
}

/* Page Layout Utilities */
.page-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    div.loginContainer {
        margin: 20px 15px;
        padding: 30px 20px;
    }
    
    .container {
        margin: 15px;
        padding: 20px 16px;
    }
    
    button.options {
        width: 100%;
        margin: 8px 0;
    }
    
    img.news {
        max-width: 100%;
    }
    
    .nav-link {
        margin: 4px 0;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .header-text h3,
    .header-text h4 {
        font-size: 1.5rem;
    }
    
    .menu-grid {
        grid-template-columns: 1fr;
    }
    
    .menu-item {
        flex-direction: column;
        text-align: center;
        padding: 24px 16px;
    }
    
    .item-icon {
        margin-right: 0;
        margin-bottom: 12px;
    }
    
    .form-container {
        padding: 24px 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-submit, .btn-cancel {
        width: 100%;
    }
    
    .help-card {
        flex-direction: column;
        text-align: center;
    }
    
    .user-info {
        justify-content: center;
        margin: 10px 0;
    }
}

@media (max-width: 576px) {
    div.pageTitle h4 {
        font-size: 1.25rem;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}
