/* Shared CSS for PTG Dashboard */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.page-container {
    position: absolute;
    top: 0;
    left: 0;
}

.page-content-container {
    position: absolute;
    top: 0;
    left: 0;
    width: calc(100% - 280px);
}

/* Dashboard Container */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background: white;
    color: #2c3e50;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    position: fixed;
    height: 100vh;
    overflow: hidden;
    z-index: 1000;
    border-right: 1px solid #e0e6ed;
}

.sidebar-header {
    margin: 10px 10px 15px 10px;
    padding: 8px 12px;
    border-bottom: 1px solid #e0e6ed;
    border-radius: 30px 20px 20px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(to right, #194D3D, #81C344);
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 45px;
    flex-shrink: 0;
}

.sidebar-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    justify-content: center;
    min-width: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    flex-shrink: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    white-space: nowrap;
    line-height: 1.2;
}

.sidebar-header .brand-name {
    font-weight: 700;
    font-size: 1.15rem;
}

.sidebar-header .app-name {
    font-weight: 400;
    font-style: italic;
    font-size: 1rem;
}

.sidebar-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.toggle-icon {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
    transition: transform 0.3s ease;
}

.sidebar-toggle:hover .toggle-icon {
    transform: scale(1.1);
}

/* Collapsed Sidebar */
.sidebar.collapsed {
    width: 80px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed .sidebar-header-content h2,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .sidebar-toggle {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

.sidebar.collapsed .nav-section-header {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center !important;
    padding: 10px;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    margin: 15px auto;
    border-bottom: none;
}

.sidebar.collapsed .sidebar-header-content {
    justify-content: center;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar.collapsed .sidebar-logo {
    width: 32px !important;
    height: 32px !important;
    cursor: pointer;
    transition: transform 0.3s ease;
    display: block !important;
}

.sidebar.collapsed .sidebar-logo:hover {
    transform: scale(1.1);
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 15px;
}

.sidebar.collapsed .nav-icon {
    margin-right: 0;
}

.sidebar.collapsed .main-content {
    margin-left: 80px;
}

.sidebar-nav {
    flex: 1;
    padding: 0 15px 10px 15px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.nav-section-header {
    padding: 10px 15px 8px 15px;
    border-bottom: 1px solid #e0e6ed;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.nav-section-header h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #7f8c8d;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-nav ul {
    list-style: none;
    flex: 1;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.nav-item {
    margin-bottom: 0;
}

.nav-item:not(.active) .nav-link:hover {
    background-color: #E0ECD4;
    color: #2c3e50;
    outline: 1px solid #01A550;
    border-radius: 8px;
}

.nav-item:not(.active) .nav-link:hover .nav-icon {
    filter: brightness(0) saturate(100%) invert(12%) sepia(79%) saturate(2476%) hue-rotate(169deg) brightness(118%) contrast(119%);
    opacity: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: #5a6c7d;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-bottom: 6px;
    box-sizing: border-box;
}

.nav-icon {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    filter: brightness(0) saturate(100%) invert(35%) sepia(8%) saturate(1090%) hue-rotate(169deg) brightness(93%) contrast(86%);
    opacity: 0.8;
    transition: all 0.3s ease;
}


.nav-item.active .nav-link {
    background-color: #E0ECD4 !important;
    color: #017a3d !important;
    outline: 1px solid #01A550 !important;
    border-radius: 8px !important;
    margin-bottom: 6px !important;
}

.nav-item.active .nav-link .nav-icon {
    filter: brightness(0) saturate(100%) invert(12%) sepia(79%) saturate(2476%) hue-rotate(169deg) brightness(118%) contrast(119%) !important;
    opacity: 1 !important;
}

.nav-item.active .nav-link:hover {
    background-color: #c8e6b8 !important;
    color: #017a3d !important;
}

.nav-text {
    font-weight: 500;
}

.sidebar-user-info {
    padding: 12px 15px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border-radius: 50%;
    flex-shrink: 0;
}

.user-avatar-icon {
    width: 24px;
    height: 24px;
}

.sidebar-user-info .user-info {
    flex: 1;
    text-align: left;
}

.sidebar-user-info .user-name {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.sidebar-user-info .user-role {
    display: block;
    font-size: 0.85rem;
    color: #7f8c8d;
}

.sidebar.collapsed .sidebar-user-info {
    padding: 10px;
    justify-content: center;
}

.sidebar.collapsed .user-avatar {
    width: 40px;
    height: 40px;
}

.sidebar.collapsed .user-avatar-icon {
    width: 24px;
    height: 24px;
}

.sidebar.collapsed .sidebar-user-info .user-info {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

.sidebar-footer {
    padding: 10px 15px;
    border-top: 1px solid #e0e6ed;
    flex-shrink: 0;
}

.logout-btn {
    width: 100%;
    background: none;
    border: none;
    color: #5a6c7d;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
}

.logout-btn:hover {
    background-color: #fdf2f2;
    color: #e74c3c;
}

.logout-btn:hover .nav-icon {
    filter: brightness(0) saturate(100%) invert(27%) sepia(51%) saturate(2878%) hue-rotate(346deg) brightness(104%) contrast(97%);
    opacity: 1;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-header {
    background: white;
    padding: 15px 30px;
    border-bottom: 1px solid #e0e6ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.header-left h1 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 5px;
}

.header-left p {
    color: #7f8c8d;
    font-size: 1rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    text-align: right;
}

.user-name {
    display: block;
    font-weight: 600;
    color: #2c3e50;
}

.user-role {
    display: block;
    font-size: 0.9rem;
    color: #7f8c8d;
}


.content-area {
    flex: 1;
    padding: 30px;
    background: #f5f7fa;
}

/* Button Styles Removed for Flexibility */

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.filter-select,
.search-input,
.control-select {
    width: 100%;
    padding: 15px 30px;
    border: 2px solid #e0e6ed;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.filter-select:focus,
.search-input:focus,
.control-select:focus {
    outline: none;
    border-color: #3498db;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.resolved {
    background: #d1ecf1;
    color: #0c5460;
}

.status-badge.warning {
    background: #fff3cd;
    color: #856404;
}

.status-badge.success {
    background: #d4edda;
    color: #155724;
}

.status-badge.critical {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.in-progress {
    background: #cce5ff;
    color: #004085;
}

/* Priority Badges */
.priority-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.priority-badge.high {
    background: #f8d7da;
    color: #721c24;
}

.priority-badge.medium {
    background: #fff3cd;
    color: #856404;
}

.priority-badge.low {
    background: #d4edda;
    color: #155724;
}

/* Role Badges */
.role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.role-badge.admin {
    background: #e74c3c;
    color: white;
}

.role-badge.manager {
    background: #f39c12;
    color: white;
}

.role-badge.operator {
    background: #3498db;
    color: white;
}

.role-badge.viewer {
    background: #95a5a6;
    color: white;
}

/* Severity Badges */
.severity-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.severity-badge.critical {
    background: #e74c3c;
    color: white;
}

.severity-badge.warning {
    background: #f39c12;
    color: white;
}

.severity-badge.info {
    background: #3498db;
    color: white;
}





/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

/* Logout Popup Styles */
.logout-popup {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e6ed;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 260px;
    text-align: center;
}

.logout-popup.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-20px);
}



.logout-popup::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 9px solid transparent;
    border-top-color: #e0e6ed;
    margin-top: 1px;
}

.logout-popup-message {
    font-size: 1rem;
    color: #2c3e50;
    margin-bottom: 20px;
    font-weight: 500;
}

.logout-popup-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.logout-popup-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.logout-popup-cancel {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #e9ecef;
}

.logout-popup-cancel:hover {
    background: #e9ecef;
    color: #495057;
}

.logout-popup-confirm {
    background: #e74c3c;
    color: white;
}

.logout-popup-confirm:hover {
    background: #c0392b;
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive Design for Laptop/Notebook screens */
@media (max-width: 1300px) {
    .sidebar {
        width: 250px;
    }
    
    .main-content {
        margin-left: 250px;
    }
    
    .sidebar.collapsed .main-content {
        margin-left: 65px;
    }
    
    .sidebar.collapsed {
        width: 65px;
    }
    
    .sidebar-header {
        margin: 8px 8px 12px 8px;
        padding: 6px 10px;
        min-height: 40px;
    }
    
    .sidebar-logo {
        width: 35px;
        height: 35px;
    }
    
    .sidebar-header h2 {
        font-size: 1rem;
    }
    
    .nav-link {
        padding: 10px 12px;
        margin-bottom: 4px;
    }
    
    .nav-icon {
        width: 16px;
        height: 16px;
        margin-right: 10px;
    }
    
    .nav-item.active .nav-link {
        margin-bottom: 4px !important;
    }
    
    .nav-text {
        font-size: 0.9rem;
    }
    
    .main-header {
        padding: 12px 25px;
    }
    
    .header-left h1 {
        font-size: 1.4rem;
    }
    
    .content-area {
        padding: 25px;
    }
    
    .header-right {
        gap: 15px;
    }
    
    .filter-group {
        padding: 6px 10px;
    }
}

@media (max-width: 1200px) {
    .sidebar {
        width: 220px;
    }
    
    .main-content {
        margin-left: 220px;
    }
    
    .sidebar.collapsed .main-content {
        margin-left: 60px;
    }
    
    .sidebar.collapsed {
        width: 60px;
    }
    
    .sidebar-header {
        margin: 6px 6px 10px 6px;
        padding: 5px 8px;
        min-height: 35px;
    }
    
    .sidebar-logo {
        width: 32px;
        height: 32px;
    }
    
    .sidebar-header h2 {
        font-size: 0.95rem;
    }
    
    .nav-link {
        padding: 8px 10px;
        margin-bottom: 3px;
    }
    
    .nav-icon {
        width: 15px;
        height: 15px;
        margin-right: 8px;
    }
    
    .nav-item.active .nav-link {
        margin-bottom: 3px !important;
    }
    
    .nav-text {
        font-size: 0.85rem;
    }
    
    .sidebar-user-info {
        padding: 10px 12px;
    }
    
    .user-avatar {
        width: 35px;
        height: 35px;
    }
    
    .user-avatar-icon {
        width: 20px;
        height: 20px;
    }
    
    .sidebar-user-info .user-name {
        font-size: 0.9rem;
    }
    
    .sidebar-user-info .user-role {
        font-size: 0.8rem;
    }
    
    .sidebar-footer {
        padding: 8px 10px;
    }
    
    .logout-btn {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
    
    .main-header {
        padding: 10px 20px;
    }
    
    .header-left h1 {
        font-size: 1.3rem;
    }
    
    .header-left p {
        font-size: 0.9rem;
    }
    
    .content-area {
        padding: 20px;
    }
    
    .header-right {
        gap: 12px;
    }
    
    .filter-group {
        padding: 5px 8px;
    }
    
    .branch-filter,
    .date-filter {
        font-size: 0.8rem;
        padding: 5px 8px;
        min-width: 100px;
    }
}

