/**
 * Modern Style CSS for Public Help Desk
 * This includes updated styling for modern UI components
 */

/* Ticker styles for horizontal scrolling */
.ticker-section {
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
    padding: 0.5rem 0;
    overflow: hidden;
}

.ticker-label {
    background-color: #dc3545;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    z-index: 2;
    position: relative;
}

.ticker-container {
    overflow: hidden;
    width: 100%;
    position: relative;
    height: 40px;
}

.ticker-wrapper {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    will-change: transform;
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 0 15px;
}

.ticker-link {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.ticker-link:hover {
    color: #0d6efd;
    text-decoration: underline;
}

/* Ticker animation */
@keyframes tickerScroll {
    0% {
        transform: translate3d(100%, -50%, 0);
    }
    100% {
        transform: translate3d(-100%, -50%, 0);
    }
}

/* Additional responsive adjustments for ticker */
@media (max-width: 768px) {
    .ticker-label {
        padding: 0.4rem 0.7rem;
        font-size: 0.9rem;
    }
    
    .ticker-item {
        padding: 0 10px;
        font-size: 0.9rem;
    }

    /* Ensure animation is smooth on mobile */
    @keyframes tickerScroll {
        0% {
            transform: translate3d(100%, -50%, 0);
        }
        100% {
            transform: translate3d(-100%, -50%, 0);
        }
    }
}

/* Fix for specific browsers */
@supports (-ms-ime-align: auto) {
    /* Edge specific fixes */
    .ticker-wrapper {
        animation: tickerScrollEdge 15s linear infinite;
    }
    
    @keyframes tickerScrollEdge {
        0% {
            left: 100%;
        }
        100% {
            left: -100%;
        }
    }
}

/* Fix for Safari */
@supports (-webkit-overflow-scrolling: touch) {
    .ticker-container {
        -webkit-mask-image: -webkit-linear-gradient(left, transparent 0%, black 5%, black 95%, transparent 100%);
        mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
    }
}

/* Additional animation class for ticker */
.ticker-animate {
    animation: tickerScroll 15s linear infinite;
}

/* Service Cards - Enhanced Styling */
.service-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: none;
    border-radius: 15px;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    height: 100%;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(45deg, #007bff, #6610f2, #6f42c1, #e83e8c, #dc3545, #fd7e14, #ffc107, #28a745, #20c997, #17a2b8);
    background-size: 300% 300%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.service-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.service-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(45deg, #007bff, #0056b3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.service-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.3), transparent);
    transform: rotate(-45deg);
    transition: all 0.5s;
    opacity: 0;
}

.service-card:hover .service-icon::before {
    animation: shimmer 0.8s ease-in-out;
    opacity: 1;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(-45deg); }
    100% { transform: translateX(100%) rotate(-45deg); }
}

.service-icon i {
    font-size: 1.8rem;
    color: white;
    z-index: 2;
    position: relative;
}

.service-card h5 {
    color: #2c3e50;
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.service-card p {
    color: #6c757d;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    font-size: 0.95rem;
}

.service-card .btn {
    border-radius: 25px;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.service-card .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
    z-index: -1;
}

.service-card .btn:hover::before {
    left: 100%;
}

/* Modern Public Helpdesk Button */
.phd-btn {
  display: inline-block;
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 2rem;
  padding: 0.7em 2em;
  font-size: 1.1rem;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,123,255,0.10);
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
  cursor: pointer;
  outline: none;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}
.phd-btn:hover, .phd-btn:focus {
  background: #0056b3;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0,86,179,0.18);
  transform: translateY(-2px) scale(1.03);
  text-decoration: none;
}
.phd-btn:active {
  background: #004080;
  box-shadow: 0 2px 8px rgba(0,86,179,0.10);
  transform: scale(0.98);
}
@media (max-width: 600px) {
  .phd-btn {
    font-size: 1rem;
    padding: 0.6em 1.2em;
  }
}

/* Section Header Enhanced */
.section-header.text-center h2 {
    position: relative;
    display: inline-block;
}

.section-header.text-center h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: linear-gradient(45deg, #007bff, #6610f2);
    border-radius: 2px;
}

/* Important Links Page Styling */
.link-row {
    transition: all 0.3s ease;
}

.link-row:hover {
    background-color: rgba(0, 123, 255, 0.05);
    transform: translateY(-1px);
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.link-details .form-label {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.link-details .form-control-plaintext {
    padding: 0.5rem 0;
    margin-bottom: 0;
    word-wrap: break-word;
}

.btn-group .btn {
    transition: all 0.3s ease;
}

.btn-group .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.table th {
    border-top: none;
    font-weight: 600;
    color: #495057;
    background-color: #f8f9fa;
}

.modal-content {
    border: none;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
    border-radius: 10px 10px 0 0;
}

.badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
}

/* Fix for modal backdrop and display issues */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5) !important;
    opacity: 1 !important;
}

.modal {
    background: transparent !important;
}

.modal.show {
    display: block !important;
}

.modal-dialog {
    margin: 1.75rem auto !important;
    max-width: 800px !important;
}

.modal-content {
    background-color: #fff !important;
    border: 1px solid rgba(0, 0, 0, 0.2) !important;
    border-radius: 0.375rem !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
    position: relative !important;
    z-index: 1055 !important;
}

.modal-header {
    border-bottom: 1px solid #dee2e6 !important;
}

.modal-footer {
    border-top: 1px solid #dee2e6 !important;
}

/* Ensure modals work on mobile */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 0.5rem !important;
        max-width: calc(100% - 1rem) !important;
    }
}

/* Responsive improvements */
@media (max-width: 768px) {
    .btn-group {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .btn-group .btn {
        width: 100%;
        margin: 0;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .service-card {
        padding: 1.5rem 1rem;
        margin-bottom: 1rem;
    }
    
    .service-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 1rem;
    }
    
    .service-icon i {
        font-size: 1.5rem;
    }
    
    .service-card h5 {
        font-size: 1.1rem;
    }
    
    .service-card p {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
}

/* Debug styles to check button clickability */
.hero-section .btn {
    position: relative !important;
    z-index: 1000 !important;
    pointer-events: auto !important;
}

.hero-section .d-flex {
    position: relative !important;
    z-index: 999 !important;
}

/* Ensure buttons are properly displayed */
.btn-light, .btn-outline-light {
    cursor: pointer !important;
    user-select: none !important;
    text-decoration: none !important;
    display: inline-block !important;
}

/* Remove any potential overlays */
.hero-section::before {
    pointer-events: none !important;
}

.hero-section .container {
    position: relative !important;
    z-index: 1001 !important;
}

/* Inline Form Styles for Admin Content Management */
.admin-inline-form-card {
    border: 2px solid #007bff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 123, 255, 0.1);
    transition: all 0.3s ease;
}

.admin-inline-form-card:not(.d-none) {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.admin-inline-form-card .card-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border-bottom: none;
    padding: 1rem 1.5rem;
}

.admin-inline-form-card .card-body {
    padding: 1.5rem;
    background-color: #f8f9fa;
}

.admin-inline-form-card .form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.admin-inline-form-card .btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    padding: 0.6rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.admin-inline-form-card .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.admin-inline-form-card .btn-secondary {
    background-color: #6c757d;
    border: none;
    padding: 0.6rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.admin-inline-form-card .btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
}

/* Form field improvements */
.admin-inline-form-card .form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.admin-inline-form-card .form-text {
    color: #6c757d;
    font-size: 0.875rem;
}

.admin-inline-form-card .form-check-label {
    font-weight: 500;
    color: #495057;
}

/* Error Prevention Styles */
.error-prevention {
    display: none; /* Hide error prevention elements */
}

/* Console Error Fixes */
.admin-page {
    position: relative;
}

/* Fix for overlapping tab content */
.tab-content .tab-pane {
    position: relative;
    z-index: 1;
}

.tab-content .tab-pane.active {
    z-index: 2;
}

/* Ensure tab buttons are properly styled */
.nav-tabs .nav-link {
    transition: all 0.3s ease;
}

.nav-tabs .nav-link.active {
    font-weight: 600;
    border-bottom-color: transparent;
}

/* Fix for modal backdrop issues */
.modal-backdrop {
    z-index: 1040;
}

.modal {
    z-index: 1050;
}

/* Prevent script loading errors from affecting UI */
.js-error-fallback {
    display: none;
}

body.js-disabled .js-error-fallback {
    display: block;
}
