﻿/* Global Styles */

/* Modern SweetAlert2 Modal Styles */
.swal2-popup {
    border-radius: 16px !important;
    padding: 2rem !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15) !important;
}

.swal2-icon {
    margin: 1.5rem auto 1rem !important;
    border-width: 3px !important;
}

.swal2-icon.swal2-question {
    border-color: #0891b2 !important;
    color: #0891b2 !important;
}

.swal2-icon.swal2-warning {
    border-color: #f59e0b !important;
    color: #f59e0b !important;
}

.swal2-icon.swal2-error {
    border-color: #ef4444 !important;
}

.swal2-icon.swal2-success {
    border-color: #10b981 !important;
}

.swal2-title {
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    padding: 0.5rem 0 !important;
}

.swal2-html-container {
    font-size: 0.95rem !important;
    color: #64748b !important;
    margin: 1rem 0 1.5rem !important;
}

.swal2-actions {
    gap: 0.75rem !important;
    margin-top: 1.5rem !important;
}

.swal2-confirm {
    background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%) !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 0.625rem 1.75rem !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    box-shadow: 0 2px 8px rgba(8, 145, 178, 0.3) !important;
    transition: all 0.2s ease !important;
}

.swal2-confirm:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.4) !important;
}

.swal2-confirm:focus {
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.2) !important;
}

.swal2-cancel {
    background: #ffffff !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 0.625rem 1.75rem !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    color: #64748b !important;
    transition: all 0.2s ease !important;
}

.swal2-cancel:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #475569 !important;
    transform: translateY(-1px) !important;
}

.swal2-cancel:focus {
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.2) !important;
}

.swal2-styled:focus {
    outline: none !important;
}

/* Backdrop */
.swal2-container {
    backdrop-filter: blur(2px) !important;
}

.swal2-backdrop-show {
    background: rgba(15, 23, 42, 0.5) !important;
}

/* Bootstrap Modal Styles (Alternative) */
.modal-content,
.modal .modal-content,
div.modal-content {
    border-radius: 16px !important;
    border: none !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15) !important;
    overflow: hidden !important;
}

.modal-header {
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 1.5rem !important;
    border-radius: 16px 16px 0 0 !important;
}

.modal-title {
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    color: #1e293b !important;
}

.modal-body {
    padding: 1rem 1.5rem !important;
    color: #64748b !important;
    text-align: center !important;
}

.modal-body .display-2 {
    margin-bottom: 1.5rem !important;
}

.modal-body .fa-circle-question,
.modal-body i[class*="fa-circle"] {
    font-size: 4rem !important;
    color: #0891b2 !important;
}

.modal-footer {
    border-top: 1px solid #e2e8f0 !important;
    padding: 1.25rem 1.5rem 1.5rem !important;
    gap: 0.75rem !important;
    display: flex !important;
    justify-content: center !important;
}

.modal-footer .btn-primary,
.modal-body + .modal-footer .btn-primary {
    background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%) !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 0.625rem 1.75rem !important;
    font-weight: 500 !important;
    box-shadow: 0 2px 8px rgba(8, 145, 178, 0.3) !important;
    transition: all 0.2s ease !important;
}

.modal-footer .btn-primary:hover,
.modal-body + .modal-footer .btn-primary:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.4) !important;
}

.modal-footer .btn-secondary,
.modal-footer .btn-outline-secondary,
.modal-footer .btn-outline-primary {
    background: #ffffff !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 0.625rem 1.75rem !important;
    font-weight: 500 !important;
    color: #64748b !important;
    transition: all 0.2s ease !important;
}

.modal-footer .btn-secondary:hover,
.modal-footer .btn-outline-secondary:hover,
.modal-footer .btn-outline-primary:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #475569 !important;
    transform: translateY(-1px) !important;
}

.modal-backdrop {
    backdrop-filter: blur(2px) !important;
    background: rgba(15, 23, 42, 0.5) !important;
}

.modal.fade.show .modal-dialog {
    transform: scale(1) !important;
}

.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out !important;
    transform: scale(0.95) !important;
}

/* ===
=====================================
   Modern Data Table Styles (Shared)
   Used by: AgencySetting, Parameters, etc.
   ======================================== */

/* Card Styles */
.card-header-custom {
    background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
    color: white;
    padding: 1.25rem;
    border-radius: 0.5rem 0.5rem 0 0;
    position: relative;
}

.card-custom {
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border-radius: 0.75rem;
    overflow: hidden;
}

/* Modern Table Base Styles */
.modern-table {
    font-size: 0.75rem;
    width: 100% !important;
    table-layout: fixed;
}

.modern-table thead th {
    background: #ffffff;
    font-weight: 600;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    border-right: 1px solid #f1f5f9;
    padding: 10px 6px;
    vertical-align: top;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.modern-table thead th:last-child {
    border-right: none;
}

.modern-table thead th i {
    font-size: 0.65rem;
    opacity: 0.7;
}

.modern-table thead th .form-select,
.modern-table thead th .form-control {
    text-transform: none;
    font-weight: normal;
}

.modern-table thead th .input-group {
    display: inline-flex !important;
    width: 100% !important;
    max-width: 100% !important;
    flex-wrap: nowrap !important;
}

.modern-table thead th .input-group .form-select {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.modern-table thead th .input-group .btn {
    flex: 0 0 auto !important;
}

.modern-table tbody td {
    vertical-align: middle;
    padding: 8px 6px;
    border-right: 1px solid #f8fafc;
    font-size: 0.75rem;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modern-table tbody td:last-child {
    border-right: none;
}

.modern-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.15s ease;
}

.modern-table tbody tr:hover:not([style*="background-color"]) {
    background-color: #f8fafc;
}

.modern-table .form-control-sm,
.modern-table .form-select-sm {
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    height: auto;
    width: 100%;
}

.modern-table input[type="text"],
.modern-table input[type="number"] {
    width: 100%;
}

.modern-table select {
    width: 100%;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.table-responsive .modern-table {
    margin: 0;
    min-width: 100%;
}

.modern-table .form-check-input {
    margin: 0;
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.modern-table .form-check-input:disabled {
    cursor: not-allowed;
}

/* Row Edit States */
.table-row-new {
    background-color: #d1e7dd !important;
}

.table-row-edit {
    background-color: #cff4fc !important;
}

.table-row-edit:hover {
    background-color: #b8edf7 !important;
}

/* Button Styles */
.btn-sm {
    padding: 0.2rem 0.4rem;
    font-size: 0.75rem;
}

/* Responsive Styles */
@media (max-width: 1200px) {
    .modern-table {
        font-size: 0.7rem;
    }
    
    .modern-table thead th {
        padding: 8px 4px;
        font-size: 0.65rem;
    }
    
    .modern-table tbody td {
        padding: 6px 4px;
        font-size: 0.7rem;
    }
    
    .btn-sm {
        padding: 0.15rem 0.3rem;
        font-size: 0.7rem;
    }
}

@media (max-width: 768px) {
    .card-header-custom h4 {
        font-size: 1rem;
    }
    
    .modern-table {
        font-size: 0.65rem;
        table-layout: auto;
    }
    
    .modern-table th,
    .modern-table td {
        min-width: auto !important;
        width: auto !important;
    }
    
    .modern-table thead th {
        padding: 6px 3px;
        font-size: 0.6rem;
    }
    
    .modern-table tbody td {
        padding: 5px 3px;
        font-size: 0.65rem;
    }
    
    .btn-sm {
        padding: 0.1rem 0.25rem;
        font-size: 0.65rem;
    }
    
    .btn-sm i {
        font-size: 0.65rem;
    }
    
    .modern-table .form-check-input {
        width: 14px;
        height: 14px;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding: 0.5rem;
    }
    
    .card-header-custom {
        padding: 0.75rem;
    }
    
    .card-header-custom h4 {
        font-size: 0.9rem;
    }
}

.wizard-container {
    display: flex;
    align-items: stretch;
    width: 100%;
    margin-bottom: 20px;
    overflow-x: auto;
}

.wizard-step {
    position: relative;
    padding: 15px 15px;
    background: #e9ecef;
    border: 1px solid #ddd;
    font-weight: 500;
    white-space: nowrap;
    flex: 1;
    text-align: center;
}

.wizard-step:not(:last-child) {
    margin-right: 20px;
}

/* ARROW EFFECT */
.wizard-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 0;
    right: -30px;
    width: 0;
    height: 0;
    border-top: 22px solid transparent;
    border-bottom: 22px solid transparent;
    border-left: 30px solid #e9ecef;   /* Background rengi */
    z-index: 2;
}

.wizard-step:not(:last-child)::before {
    content: "";
    position: absolute;
    top: 0;
    right: -31px;
    width: 0;
    height: 0;
    border-top: 23px solid transparent;
    border-bottom: 23px solid transparent;
    border-left: 31px solid #ddd;      /* Border rengi */
    z-index: 1;
}

/* ACTIVE STATE */
.wizard-active {
    background: #d9534f !important;
    color: white !important;
    border-color: #b52b27;
}

.wizard-active:not(:last-child)::after {
    border-left-color: #d9534f !important;
}

.wizard-active:not(:last-child)::before {
    border-left-color: #b52b27 !important;
}

/* Navigation Menu Fixes */
.navbar-brand img {
    max-height: 40px;
    width: auto;
    object-fit: contain;
}

.navbar .dropdown {
    position: relative;
}

.navbar .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    min-width: 200px;
    margin-top: 0.125rem;
    display: none;
}

.navbar .dropdown-menu.show {
    display: block;
}

.navbar .dropdown-toggle {
    cursor: pointer;
    user-select: none;
}

.navbar .dropdown-toggle:hover {
    opacity: 0.8;
}

/* Hover-based dropdown for better UX */
.navbar .nav-item.dropdown:hover > .dropdown-menu {
    display: block;
}

/* Dropdown submenu styles */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -1px;
    margin-left: -1px;
}

.dropdown-submenu:hover > .dropdown-menu {
    display: block;
}

.dropdown-item {
    cursor: pointer;
    padding: 0.5rem 1rem;
    display: block;
    width: 100%;
    clear: both;
    font-weight: 400;
    color: #212529;
    text-align: inherit;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
    text-decoration: none;
}

.dropdown-item:hover,
.dropdown-item:focus {
    color: #16181b;
    text-decoration: none;
    background-color: #f8f9fa;
}

.dropdown-item.disabled,
.dropdown-item:disabled {
    color: #6c757d;
    pointer-events: none;
    background-color: transparent;
}

/* Ensure dropdown arrow indicator */
.dropdown-toggle::after {
    display: inline-block;
    margin-left: 0.255em;
    vertical-align: 0.255em;
    content: "";
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
}

.brand-container {
    display: none !important;
}

/* Login Page Background Logo */
body:has(.card-body #login-form)::before,
.container-fluid:has(#login-form)::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/Images/mma-logo-transparent.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 100%;
    opacity: 0.05;
    z-index: -1;
    pointer-events: none;
}
