/**
 * STLI Logistics - Additional Styles
 * Modals, Notifications, and Extra Components
 */

/* ====================================
   Tracking Modal
   ==================================== */
.tracking-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 1rem;
}

.tracking-modal.active {
    opacity: 1;
    visibility: visible;
}

.tracking-modal-content {
    background: var(--white);
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 3rem;
    position: relative;
    box-shadow: var(--shadow-xl);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.tracking-modal.active .tracking-modal-content {
    transform: scale(1);
}

.tracking-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--light-gray);
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tracking-modal-close:hover {
    background: var(--accent-orange);
    color: var(--white);
    transform: rotate(90deg);
}

.tracking-modal h3 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--primary-navy);
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--accent-orange);
}

.tracking-modal h4 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    color: var(--primary-blue);
}

.tracking-info {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.tracking-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    background: var(--light-gray);
    border-radius: 8px;
    border-left: 4px solid var(--accent-orange);
}

.tracking-info-item strong {
    color: var(--primary-navy);
    font-weight: 600;
}

.tracking-info-item span {
    color: var(--dark-gray);
    font-weight: 500;
}

.status-badge {
    background: var(--accent-teal);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.tracking-timeline {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.timeline-item {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--white);
    border: 2px solid var(--medium-gray);
    border-radius: 8px;
    position: relative;
    transition: var(--transition-fast);
}

.timeline-item:hover {
    border-color: var(--accent-orange);
    box-shadow: var(--shadow-sm);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 170px;
    top: -1.5rem;
    width: 2px;
    height: calc(100% + 3rem);
    background: var(--medium-gray);
}

.timeline-item:first-child::before {
    top: 50%;
    height: calc(50% + 1.5rem);
}

.timeline-item:last-child::before {
    height: calc(50% + 1.5rem);
}

.timeline-date {
    font-family: var(--font-accent);
    font-weight: 700;
    color: var(--accent-orange);
    font-size: 0.95rem;
    text-align: right;
}

.timeline-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.timeline-location {
    font-weight: 700;
    color: var(--primary-navy);
    font-size: 1.1rem;
}

.timeline-status {
    color: var(--dark-gray);
    font-size: 0.95rem;
}

/* ====================================
   Notifications
   ==================================== */
.stli-notification {
    position: fixed;
    top: 100px;
    right: -400px;
    max-width: 350px;
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: right 0.3s ease;
}

.stli-notification.show {
    right: 2rem;
}

.stli-notification i {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stli-notification.info {
    border-left: 4px solid var(--primary-blue);
}

.stli-notification.info i {
    color: var(--primary-blue);
}

.stli-notification.success {
    border-left: 4px solid #28a745;
}

.stli-notification.success i {
    color: #28a745;
}

.stli-notification.error {
    border-left: 4px solid #dc3545;
}

.stli-notification.error i {
    color: #dc3545;
}

.stli-notification.warning {
    border-left: 4px solid #ffc107;
}

.stli-notification.warning i {
    color: #ffc107;
}

/* ====================================
   Back to Top Button
   ==================================== */
.back-to-top {
    position: fixed;
    bottom: -60px;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--accent-orange);
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    z-index: 999;
}

.back-to-top.show {
    bottom: 2rem;
}

.back-to-top:hover {
    background: var(--primary-navy);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* ====================================
   Breadcrumb
   ==================================== */
.breadcrumb {
    background: var(--white);
    padding: 1rem 0;
    border-bottom: 1px solid var(--medium-gray);
    margin-bottom: 2rem;
}

.breadcrumb a {
    color: var(--primary-blue);
    transition: var(--transition-fast);
}

.breadcrumb a:hover {
    color: var(--accent-orange);
}

/* ====================================
   Loading Spinner
   ==================================== */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ====================================
   Scroll Animations
   ==================================== */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* ====================================
   Mobile Menu Overlay
   ==================================== */
body.menu-open {
    overflow: hidden;
}

body.menu-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ====================================
   Form Validation States
   ==================================== */
.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: #dc3545;
}

.form-group .error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: none;
}

.form-group.has-error .error-message {
    display: block;
}

.form-group input.success,
.form-group select.success,
.form-group textarea.success {
    border-color: #28a745;
}

/* ====================================
   Tooltips
   ==================================== */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    padding: 0.5rem 1rem;
    background: var(--charcoal);
    color: var(--white);
    font-size: 0.875rem;
    white-space: nowrap;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--charcoal);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
}

/* ====================================
   Responsive Adjustments
   ==================================== */
@media (max-width: 768px) {
    .tracking-modal-content {
        padding: 2rem;
    }
    
    .timeline-item {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .timeline-item::before {
        display: none;
    }
    
    .timeline-date {
        text-align: left;
    }
    
    .stli-notification {
        left: 1rem;
        right: 1rem;
        max-width: none;
    }
    
    .stli-notification.show {
        right: 1rem;
    }
    
    .back-to-top {
        right: 1rem;
    }
}

/* ====================================
   News Page Shortcode Styles
   ==================================== */
.stli-news-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Top Section - Featured + Sidebar */
.news-top-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Featured Article */
.news-featured-main {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.news-featured-thumb {
    position: relative;
    height: 400px;
    overflow: hidden;
}

.news-featured-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-featured-main:hover .news-featured-thumb img {
    transform: scale(1.05);
}

.news-featured-content {
    padding: 2rem;
}

.news-category {
    display: inline-block;
    background: var(--accent-red);
    color: var(--white);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

.news-featured-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.news-featured-title a {
    color: var(--primary-navy);
    transition: var(--transition);
}

.news-featured-title a:hover {
    color: var(--accent-red);
}

.news-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-gray);
}

.news-author {
    font-weight: 600;
    color: var(--dark-gray);
}

.news-date {
    color: var(--text-gray);
}

.news-excerpt {
    color: var(--text-gray);
    line-height: 1.7;
    font-size: 1rem;
}

/* Sidebar Articles */
.news-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.news-sidebar-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.news-sidebar-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(5px);
}

.news-sidebar-thumb {
    flex-shrink: 0;
    width: 100px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
}

.news-sidebar-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-sidebar-item:hover .news-sidebar-thumb img {
    transform: scale(1.1);
}

.news-sidebar-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.news-sidebar-content h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.news-sidebar-content h4 a {
    color: var(--dark-gray);
    transition: var(--transition);
}

.news-sidebar-content h4 a:hover {
    color: var(--primary-blue);
}

.news-sidebar-date {
    font-size: 0.85rem;
    color: var(--text-gray);
}

/* List Articles */
.news-list-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.news-list-item {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    padding: 1.5rem;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.news-list-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.news-list-thumb {
    height: 200px;
    border-radius: 6px;
    overflow: hidden;
}

.news-list-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-list-item:hover .news-list-thumb img {
    transform: scale(1.05);
}

.news-list-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.news-list-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.news-list-title a {
    color: var(--primary-navy);
    transition: var(--transition);
}

.news-list-title a:hover {
    color: var(--primary-blue);
}

/* Pagination */
.news-pagination {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
}

.news-pagination ul {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    padding: 0;
    margin: 0;
}

.news-pagination li {
    margin: 0;
}

.news-pagination a,
.news-pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    background: var(--white);
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    color: var(--dark-gray);
    font-weight: 600;
    transition: var(--transition);
}

.news-pagination a:hover {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: var(--white);
}

.news-pagination .current {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: var(--white);
}

.no-posts {
    text-align: center;
    padding: 3rem;
    font-size: 1.25rem;
    color: var(--text-gray);
}

/* Responsive */
@media (max-width: 992px) {
    .news-top-section {
        grid-template-columns: 1fr;
    }
    
    .news-list-item {
        grid-template-columns: 1fr;
    }
    
    .news-list-thumb {
        height: 250px;
    }
}

@media (max-width: 768px) {
    .news-featured-thumb {
        height: 250px;
    }
    
    .news-featured-content {
        padding: 1.5rem;
    }
    
    .news-featured-title {
        font-size: 1.5rem;
    }
    
    .news-list-title {
        font-size: 1.25rem;
    }
    
    .news-sidebar-item {
        flex-direction: column;
    }
    
    .news-sidebar-thumb {
        width: 100%;
        height: 150px;
    }
}

/* ====================================
   Print Styles
   ==================================== */
@media print {
    .site-header,
    .site-footer,
    .back-to-top,
    .tracking-form,
    .stli-notification,
    .tracking-modal {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .service-detail,
    .single-post,
    .page-article {
        box-shadow: none !important;
        padding: 0 !important;
    }
}
