/**
 * Safety Hub Main Styles
 * 
 * @package SafetyHub_Location
 */

/* ==========================================================================
   Main Map Dashboard
   ========================================================================== */

.safetyhub-dashboard {
    display: flex;
    height: calc(100vh - 200px);
    min-height: 600px;
    gap: 0;
    background: #f9fafb;
}

/* Sidebar */
.safetyhub-sidebar {
    width: 400px;
    background: white;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.safetyhub-sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: white;
}

.safetyhub-filters {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.safetyhub-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.safetyhub-list::-webkit-scrollbar {
    width: 8px;
}

.safetyhub-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.safetyhub-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.safetyhub-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Map Container */
.safetyhub-map-container {
    flex: 1;
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 600px;
    background-color: #e5e7eb;
}

#safetyhub-map {
    width: 100% !important;
    height: 100% !important;
    min-height: 600px;
}

/* ==========================================================================
   Skeleton Loading
   ========================================================================== */

.safetyhub-skeleton {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ==========================================================================
   Add Safety Hub Form
   ========================================================================== */

.add-safetyhub-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.add-safetyhub-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.add-safetyhub-map-section {
    position: sticky;
    top: 2rem;
    height: fit-content;
}

#add-safetyhub-map {
    width: 100%;
    height: 500px;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s;
    color: #111827 !important;
    background-color: #ffffff !important;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #6b7280 !important;
}

.safetyhub-filters input,
.safetyhub-filters select {
    color: #111827 !important;
    background-color: #ffffff !important;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #DE007D;
    box-shadow: 0 0 0 3px rgba(222, 0, 125, 0.1);
}

.form-group input[readonly] {
    background-color: #f9fafb !important;
    cursor: not-allowed;
    color: #374151 !important;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-help-text {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* ==========================================================================
   Notifications
   ========================================================================== */

.safetyhub-notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    color: white;
    font-weight: 500;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease-out;
}

.safetyhub-notification.animate-slide-out {
    animation: slideOut 0.3s ease-in;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(to right, #DE007D, #F05A28);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    box-shadow: 0 10px 15px -3px rgba(222, 0, 125, 0.3);
    transform: translateY(-1px);
}

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

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

input#location-search {
    color: #000 !important;
}

button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
    .safetyhub-dashboard {
        flex-direction: column;
        height: auto;
    }

    .safetyhub-sidebar {
        width: 100%;
        max-height: 400px;
    }

    .safetyhub-map-container {
        height: 500px;
        min-height: 500px;
    }

    #safetyhub-map {
        min-height: 500px;
    }

    .add-safetyhub-grid {
        grid-template-columns: 1fr;
    }

    .add-safetyhub-map-section {
        position: relative;
        top: 0;
    }
}

@media (max-width: 640px) {
    .safetyhub-sidebar {
        max-height: 500px;
    }

    .safetyhub-map-container {
        height: 400px;
        min-height: 400px;
    }

    #safetyhub-map {
        height: 400px;
        min-height: 400px;
    }

    #add-safetyhub-map {
        height: 400px;
    }

    .add-safetyhub-container {
        padding: 1rem 0.5rem;
    }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 20px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.safetyhub-item-animate {
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
}

/* ==========================================================================
   Updated Responsive Styles (Mobile Optimized)
   ========================================================================== */

#add-safetyhub-map {
    width: 100%;
    height: 500px;
    min-height: 500px;
}

@media (max-width: 1024px) {
    .safetyhub-dashboard {
        flex-direction: column;
        height: auto;
        position: relative;
        min-height: 600px;
    }

    .safetyhub-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 9999;
        background: white;
        display: none;
        flex-direction: column;
        overflow-y: auto;
    }

    .safetyhub-sidebar.active {
        display: flex;
        animation: slideIn 0.3s ease-out;
    }

    .safetyhub-map-container {
        height: 600px;
        min-height: 600px;
        width: 100%;
    }

    #safetyhub-map {
        min-height: 600px;
    }

    .add-safetyhub-grid {
        grid-template-columns: 1fr;
    }

    .add-safetyhub-map-section {
        position: relative;
        top: 0;
    }

    #safetyhub-mobile-toggle {
        display: flex;
    }
}

@media (max-width: 640px) {
    .safetyhub-dashboard {
        min-height: 80vh;
    }

    .safetyhub-map-container,
    #safetyhub-map {
        height: 80vh;
        min-height: 80vh;
    }

    #add-safetyhub-map {
        height: 350px;
        min-height: 350px;
    }

    .add-safetyhub-container {
        padding: 1rem 0.5rem;
    }
}

.btn-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

input#location-search {
    color: #000 !important;
}

button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
    .safetyhub-dashboard {
        flex-direction: column;
        height: auto;
    }

    .safetyhub-sidebar {
        width: 100%;
        max-height: 400px;
    }

    .safetyhub-map-container {
        height: 500px;
        min-height: 500px;
    }

    #safetyhub-map {
        min-height: 500px;
    }

    .add-safetyhub-grid {
        grid-template-columns: 1fr;
    }

    .add-safetyhub-map-section {
        position: relative;
        top: 0;
    }
}

@media (max-width: 640px) {
    .safetyhub-sidebar {
        max-height: 500px;
    }

    .safetyhub-map-container {
        height: 400px;
        min-height: 400px;
    }

    #safetyhub-map {
        height: 400px;
        min-height: 400px;
    }

    #add-safetyhub-map {
        height: 400px;
    }

    .add-safetyhub-container {
        padding: 1rem 0.5rem;
    }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 20px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.safetyhub-item-animate {
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
}

/* ==========================================================================
   Updated Responsive Styles (Mobile Optimized)
   ========================================================================== */

#add-safetyhub-map {
    width: 100%;
    height: 500px;
    min-height: 500px;
}

@media (max-width: 1024px) {
    .safetyhub-dashboard {
        flex-direction: column;
        height: auto;
        position: relative;
        min-height: 600px;
    }

    .safetyhub-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 9999;
        background: white;
        display: none;
        flex-direction: column;
        overflow-y: auto;
    }

    .safetyhub-sidebar.active {
        display: flex;
        animation: slideIn 0.3s ease-out;
    }

    .safetyhub-map-container {
        height: 600px;
        min-height: 600px;
        width: 100%;
    }

    #safetyhub-map {
        min-height: 600px;
    }

    .add-safetyhub-grid {
        grid-template-columns: 1fr;
    }

    .add-safetyhub-map-section {
        position: relative;
        top: 0;
    }

    #safetyhub-mobile-toggle {
        display: flex;
    }
}

@media (max-width: 640px) {
    .safetyhub-dashboard {
        min-height: 80vh;
    }

    .safetyhub-map-container,
    #safetyhub-map {
        height: 80vh;
        min-height: 80vh;
    }

    #add-safetyhub-map {
        height: 350px;
        min-height: 350px;
    }

    .add-safetyhub-container {
        padding: 1rem 0.5rem;
    }

    .form-group input,
    .form-group select,
    .btn-primary,
    .btn-secondary {
        min-height: 48px;
    }
}

/* ==========================================================================
   List Items
   ========================================================================== */

.safetyhub-list-item {
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Normal state hover */
.safetyhub-list-item:not(.safetyhub-list-item-active):hover {
    transform: translateY(-2px);
    border: 2px solid transparent !important;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(135deg, #DE007D, #F05A28) border-box !important;
}

/* Active state - higher priority */
.safetyhub-list-item-active {
    border: 2px solid transparent !important;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(135deg, #DE007D, #F05A28) border-box !important;
}

.safetyhub-list-item-active:hover {
    transform: translateY(-2px);
}

/* ==========================================================================
   Elementor Widget Styles
   ========================================================================== */

/* Safety Hub List Widget - Dark Theme */
.safetyhub-widget-list-container {
    background: #000000;
    padding: 0;
    border-radius: 0.5rem;
}

.safetyhub-widget-list {
    display: flex;
    flex-direction: column;
}

.safetyhub-list-card {
    transition: all 0.3s ease;
}

.safetyhub-list-card:hover {
    transform: translateY(-2px);
}

/* Widget Pagination */
.safetyhub-widget-pagination .pagination-btn,
.safetyhub-widget-pagination .pagination-number {
    transition: all 0.2s ease;
}

.safetyhub-widget-empty {
    background: #1a1a1a;
    border-radius: 0.5rem;
    padding: 3rem 1rem;
}