/**
 * LiveView PHP - Main Stylesheet
 * Converted from ASP Classic styles
 */

/* Layout */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #f5f5f5;
}

.ewLayout {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

/* Header */
.ewHeaderRow {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ewHeaderRow img {
    max-height: 50px;
}

/* Content Table */
.ewContentTable {
    width: 100%;
    border-collapse: collapse;
    flex: 1;
}

.ewContentTable td {
    padding: 0;
}

.ewMenuColumn {
    width: 220px;
    min-width: 220px;
    max-width: 220px;
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
    vertical-align: top;
    overflow-x: hidden;
}

.ewContentColumn {
    padding: 10px;
    vertical-align: top;
    width: calc(100vw - 220px);
    max-width: calc(100vw - 220px);
    overflow-x: hidden;
}

.ewSiteTitle {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0d6efd;
}

/* Menu */
.ewMenu {
    font-size: 13px;
}

.ewMenu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ewMenu .nav-link {
    color: #333;
    padding: 8px 15px;
    border-radius: 4px;
    transition: all 0.2s;
}

.ewMenu .nav-link:hover {
    background-color: #e9ecef;
}

.ewMenu .nav-link.active {
    background-color: #0d6efd;
    color: white;
}

/* Forms */
.ewForm {
    max-width: 100%;
}

.form-control, .form-select {
    max-width: 100%;
}

.card {
    max-width: 100%;
}

/* Constrain form width to prevent horizontal scroll */
.card-body .form-control,
.card-body .form-select,
.card-body textarea {
    max-width: 100%;
    box-sizing: border-box;
}

/* CKEditor constraints */
.ck-editor__editable {
    max-width: 100% !important;
}

.ck.ck-editor {
    max-width: 100% !important;
}

/* Force all content to stay within bounds */
* {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Prevent text overflow */
.form-select, .form-control {
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.form-select option {
    white-space: normal;
}

.ewForm .form-label {
    font-weight: 500;
}

.ewForm .form-control:focus,
.ewForm .form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

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

.ewTable th,
.ewTable td {
    padding: 10px;
    border: 1px solid #dee2e6;
    vertical-align: middle;
}

.ewTable th {
    background-color: #f8f9fa;
    font-weight: 600;
    text-align: left;
}

.ewTable tr:hover {
    background-color: #f8f9fa;
}

.ewTable .ewRowHighlight {
    background-color: #fff3cd !important;
}

/* Buttons */
.ewButton {
    margin-right: 5px;
}

.ewButton:last-child {
    margin-right: 0;
}

/* Pagination */
.ewPager {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.ewPager .pagination {
    margin: 0;
}

/* Footer */
.ewFooterRow {
    margin-top: auto;
}

.ewFooterText {
    font-size: 12px;
}

/* Login Page */
.ewLoginContent {
    padding: 20px;
}

/* Messages */
.ewMessage {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

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

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

.ewMessageWarning {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
}

/* Action Links */
.ewActionLinks a {
    margin-right: 10px;
    text-decoration: none;
}

.ewActionLinks a:hover {
    text-decoration: underline;
}

/* Grid Add */
.ewGridAdd {
    margin-top: 20px;
}

/* Search */
.ewSearch {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .ewMenuColumn {
        display: none;
    }
    
    .ewContentColumn {
        padding: 10px;
    }
    
    .ewTable {
        font-size: 12px;
    }
    
    .ewTable th,
    .ewTable td {
        padding: 5px;
    }
}

/* Print */
@media print {
    .ewMenuColumn,
    .ewHeaderRow,
    .ewFooterRow,
    .ewPager,
    .ewActionLinks {
        display: none !important;
    }
    
    .ewContentColumn {
        width: 100% !important;
    }
}
