/*
 * Optical Forms Modern UI - Metronic 4 Style CSS
 * Fixed Height 500px with Overflow and Shadow
 * All classes prefixed with omr- to avoid conflicts
 */

/* Form Cards - Fixed Height 500px */
.omr-form-card {
    transition: all 0.3s ease;
    margin-bottom: 20px;
    height: 500px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12),
    0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e5e5;
}

.omr-form-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16),
    0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    border-color: #36c6d3;
}

.omr-form-card .portlet-body {
    padding: 0;
    height: 100%;
}

/* Scrollable Body */
.omr-scrollable-body {
    height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px !important;
}

/* Custom Scrollbar */
.omr-scrollable-body::-webkit-scrollbar {
    width: 10px;
}

.omr-scrollable-body::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-left: 1px solid #e5e5e5;
}

.omr-scrollable-body::-webkit-scrollbar-thumb {
    background: #36c6d3;
    border-radius: 5px;
}

.omr-scrollable-body::-webkit-scrollbar-thumb:hover {
    background: #2fb3c0;
}

/* Firefox Scrollbar */
.omr-scrollable-body {
    scrollbar-width: thin;
    scrollbar-color: #36c6d3 #f5f5f5;
}

/* Profile Header - Side by Side Layout */
.omr-profile-header {
    display: flex;
    gap: 15px;
    margin: 0 -20px 20px -20px;
    padding: 15px 20px;
    border-bottom: 2px solid #f0f0f0;
    background: linear-gradient(to bottom, #ffffff 0%, #fafafa 100%);
}

/* Profile Photo - Left Side */
.omr-profile-photo {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    position: relative;
}

.omr-profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    border: 3px solid #e5e5e5;
    transition: all 0.3s ease;
}

.omr-profile-photo img:hover {
    border-color: #36c6d3;
    box-shadow: 0 0 10px rgba(54, 198, 211, 0.3);
}

.omr-photo-badge {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 4px;
}

.omr-lightbox-link:hover .omr-photo-badge {
    opacity: 1;
}

.omr-photo-badge i {
    color: #fff;
    font-size: 24px;
}

.omr-no-photo {
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    border: 2px dashed #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.3s ease;
}

.omr-no-photo:hover {
    border-color: #36c6d3;
    background: #f0f9fa;
}

.omr-no-photo a {
    color: #999;
    text-decoration: none;
}

.omr-no-photo:hover a {
    color: #36c6d3;
}

/* Profile Info - Right Side */
.omr-profile-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.omr-profile-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #333;
}

.omr-profile-title a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dashed transparent;
}

.omr-profile-title a:hover {
    color: #36c6d3;
    border-bottom-color: #36c6d3;
}

.omr-profile-meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.omr-meta-item {
    font-size: 13px;
    color: #666;
}

.omr-meta-item i {
    color: #999;
    margin-right: 5px;
    width: 16px;
    text-align: center;
}

.omr-meta-item strong {
    color: #333;
}

/* Details Collapse */
.omr-details-collapse {
    margin: 15px 0;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.omr-details-collapse:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.omr-collapse-trigger {
    display: block;
    padding: 10px 15px;
    background: linear-gradient(to bottom, #f8f8f8 0%, #f0f0f0 100%);
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #e5e5e5;
    transition: all 0.3s ease;
}

.omr-collapse-trigger:hover {
    background: linear-gradient(to bottom, #f0f0f0 0%, #e8e8e8 100%);
    text-decoration: none;
}

.omr-collapse-trigger:hover strong {
    color: #36c6d3;
}

.omr-collapse-trigger.collapsed .omr-collapse-icon {
    transform: rotate(0deg);
}

.omr-collapse-trigger:not(.collapsed) .omr-collapse-icon {
    transform: rotate(180deg);
}

.omr-collapse-icon {
    transition: transform 0.3s ease;
    font-size: 16px;
    margin-top: 2px;
}

.omr-collapse-trigger .badge {
    background: #36c6d3;
    margin-left: 5px;
}

/* Details Content */
.omr-details-content {
    background: #fff;
    padding: 15px;
}

/* Parent Section Rows - 2 Columns */
.omr-parent-row {
    margin-bottom: 15px;
}

.omr-parent-row:last-child {
    margin-bottom: 0;
}

.omr-parent-row::before,
.omr-parent-row::after {
    content: " ";
    display: table;
}

.omr-parent-row::after {
    clear: both;
}

.omr-parent-col {
    margin-bottom: 15px;
}

/* Section Group */
.omr-section-group {
    height: 100%;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.omr-section-group:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.omr-section-header {
    background: linear-gradient(to right, #36c6d3 0%, #2fb3c0 100%);
    color: #fff;
    padding: 8px 12px;
    font-size: 13px;
    border-bottom: 2px solid #2fb3c0;
}

.omr-section-header i {
    margin-right: 5px;
}

.omr-section-header .badge {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 11px;
    margin-left: 5px;
}

/* Section Items Wrapper */
.omr-section-items-wrapper {
    background: #fafafa;
    padding: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.omr-section-items-wrapper::-webkit-scrollbar {
    width: 8px;
}

.omr-section-items-wrapper::-webkit-scrollbar-track {
    background: #f9f9f9;
}

.omr-section-items-wrapper::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.omr-section-items-wrapper::-webkit-scrollbar-thumb:hover {
    background: #36c6d3;
}

/* Section Item */
.omr-section-item {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    padding: 8px 10px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.omr-section-item:last-child {
    margin-bottom: 0;
}

.omr-section-item:hover {
    background: #f5f5f5;
    border-color: #36c6d3;
    box-shadow: 0 1px 3px rgba(54, 198, 211, 0.2);
}

.omr-section-name {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.omr-section-name i {
    color: #999;
    margin-right: 3px;
    font-size: 11px;
}

.omr-section-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.omr-badge-mini {
    display: inline-block;
    padding: 2px 6px;
    font-size: 10px;
    background: #e8e8e8;
    color: #666;
    border-radius: 3px;
    white-space: nowrap;
}

.omr-badge-mini i {
    font-size: 9px;
    margin-right: 2px;
}

.omr-badge-blue {
    background: #3598dc;
    color: #fff;
}

.omr-badge-green {
    background: #26C281;
    color: #fff;
}

/* Supply Collapse - Same style as Details Collapse */
.omr-supply-collapse {
    margin: 15px 0;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.omr-supply-collapse:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.omr-supply-collapse .omr-collapse-trigger {
    display: block;
    padding: 10px 15px;
    background: linear-gradient(to bottom, #f8f8f8 0%, #f0f0f0 100%);
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #e5e5e5;
    transition: all 0.3s ease;
}

.omr-supply-collapse .omr-collapse-trigger:hover {
    background: linear-gradient(to bottom, #f0f0f0 0%, #e8e8e8 100%);
    text-decoration: none;
}

.omr-supply-collapse .omr-collapse-trigger.collapsed .omr-collapse-icon {
    transform: rotate(0deg);
}

.omr-supply-collapse .omr-collapse-trigger:not(.collapsed) .omr-collapse-icon {
    transform: rotate(180deg);
}

.omr-supply-content {
    padding: 15px;
    font-size: 12px;
    background: #fff;
}

.omr-supply-content .text-muted {
    display: block;
    margin-bottom: 5px;
}

/* Actions */
.omr-actions {
    margin-top: 15px;
}

/* Buttons */
.omr-form-card .btn {
    transition: all 0.3s ease;
}

.omr-form-card .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

/* Spacing Utilities */
.margin-top-5 {
    margin-top: 5px;
}

/* Labels */
.omr-form-card .label {
    font-size: 11px;
    padding: 4px 8px;
}

/* Dropdown Menu */
.omr-form-card .dropdown-menu {
    min-width: 160px;
}

.omr-form-card .dropdown-menu > li > a {
    padding: 6px 12px;
    font-size: 12px;
}

.omr-form-card .dropdown-menu > li > a > i {
    margin-right: 6px;
    width: 14px;
    text-align: center;
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animated.fadeInUp {
    animation: fadeInUp 0.5s ease-out;
}

/* Responsive */
@media (max-width: 767px) {
    .omr-form-card {
        height: auto;
        min-height: 600px;
    }

    .omr-scrollable-body {
        height: auto;
        min-height: 600px;
    }

    .omr-profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .omr-profile-photo {
        width: 100px;
        height: 100px;
    }

    .omr-profile-meta {
        align-items: center;
    }

    .omr-parent-col {
        width: 100%;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 991px) {
    .omr-profile-photo {
        width: 100px;
        height: 100px;
    }
}

/* Desktop Large Screen */
@media (min-width: 1200px) {
    .omr-form-card {
        height: 500px;
    }

    .omr-scrollable-body {
        height: 500px;
    }
}

/* Additional Mobile Optimizations */
@media (max-width: 480px) {
    .omr-profile-photo {
        width: 90px;
        height: 90px;
    }

    .omr-profile-title {
        font-size: 14px;
    }

    .omr-meta-item {
        font-size: 12px;
    }

    .omr-section-name {
        font-size: 11px;
    }

    .omr-badge-mini {
        font-size: 9px;
        padding: 1px 4px;
    }
}

/* Print Styles */
@media print {
    .page-head,
    .page-breadcrumb,
    .omr-actions,
    .omr-photo-badge,
    .omr-supply-collapse {
        display: none !important;
    }

    .omr-form-card {
        break-inside: avoid;
        page-break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        height: auto !important;
    }

    .omr-scrollable-body {
        height: auto !important;
        overflow: visible !important;
    }

    .omr-details-collapse .collapse,
    .omr-supply-collapse .collapse {
        display: block !important;
        height: auto !important;
    }
}

/* Lightbox */
.lb-data .lb-caption {
    font-size: 14px;
    font-weight: 600;
}

/* Smooth Collapse Animation */
.omr-details-collapse .collapse,
.omr-supply-collapse .collapse {
    transition: height 0.35s ease;
}

.omr-details-collapse .collapsing,
.omr-supply-collapse .collapsing {
    position: relative;
    height: 0;
    overflow: hidden;
    transition: height 0.35s ease;
}

/* Badge Styles */
.badge-info {
    background-color: #36c6d3;
}

.badge-default {
    background-color: #95a5a6;
}

/* Focus States */
.omr-form-card a:focus,
.omr-form-card button:focus {
    outline: 2px solid #36c6d3;
    outline-offset: 2px;
}

.omr-collapse-trigger:focus {
    outline: 2px solid #36c6d3;
    outline-offset: -2px;
}

.omr-lightbox-link:focus {
    outline: 2px solid #36c6d3;
    outline-offset: 2px;
}

/* Loading State */
.omr-form-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Text Utilities */
.omr-form-card .small {
    font-size: 12px;
    line-height: 1.4;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .omr-form-card {
        border: 2px solid #000;
    }

    .omr-section-item {
        border: 2px solid #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}