/**
 * Advanced Shipment Manager Frontend Styles
 * 3D Glassmorphism Design System
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --asm-primary: #667eea;
    --asm-secondary: #764ba2;
    --asm-success: #4CAF50;
    --asm-warning: #FF9800;
    --asm-danger: #f44336;
    --asm-info: #2196F3;
    --asm-dark: #2c3e50;
    --asm-light: #f8f9fa;
    --asm-gold: #FFD700;
    
    /* 3D Effects */
    --asm-perspective: 1000px;
    --asm-rotate-x: 0deg;
    --asm-rotate-y: 0deg;
    --asm-translate-z: 0px;
}

/* Base Container */
.asm-3d-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
    perspective: var(--asm-perspective);
    font-family: 'Inter', sans-serif;
}

/* Glassmorphism Card */
.asm-glass-card {
    position: relative;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        inset 0 1px 2px rgba(255, 255, 255, 0.6);
    padding: 30px;
    margin-bottom: 30px;
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
    overflow: hidden;
}

.asm-glass-card:hover {
    transform: translateY(-5px) rotateX(2deg);
    box-shadow: 
        0 35px 60px -15px rgba(0, 0, 0, 0.3),
        inset 0 1px 3px rgba(255, 255, 255, 0.8);
}

.asm-card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, 
        rgba(255, 255, 255, 0.3) 0%, 
        transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.asm-glass-card:hover .asm-card-glow {
    opacity: 1;
    animation: rotate 10s linear infinite;
}

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

/* Gradient Text */
.asm-gradient-text {
    background: linear-gradient(135deg, var(--asm-primary), var(--asm-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: 2.5em;
    font-weight: 700;
    margin: 0 0 20px;
    text-align: center;
}

/* 3D Form */
.asm-3d-form {
    max-width: 500px;
    margin: 0 auto;
}

.asm-input-group {
    position: relative;
    margin-bottom: 20px;
}

.asm-input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--asm-primary);
    z-index: 1;
}

.asm-3d-input {
    width: 100%;
    padding: 18px 20px 18px 50px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    font-size: 16px;
    color: var(--asm-dark);
    transition: all 0.3s;
    transform-style: preserve-3d;
}

.asm-3d-input:focus {
    outline: none;
    border-color: var(--asm-primary);
    background: rgba(255, 255, 255, 0.3);
    transform: translateZ(10px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

/* 3D Button */
.asm-3d-button {
    position: relative;
    width: 100%;
    padding: 18px;
    border: none;
    border-radius: 50px;
    background: transparent;
    color: white;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.3s;
    transform-style: preserve-3d;
}

.asm-button-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--asm-primary), var(--asm-secondary));
    z-index: -1;
    transition: transform 0.3s;
}

.asm-3d-button:hover {
    transform: translateY(-3px) translateZ(20px);
}

.asm-3d-button:hover .asm-button-bg {
    transform: scale(1.05);
}

.asm-3d-button:active {
    transform: translateY(0) translateZ(10px);
}

/* Features Grid */
.asm-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 40px;
}

.asm-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    transition: transform 0.3s;
}

.asm-feature:hover {
    transform: translateY(-5px) translateZ(20px);
}

.asm-feature svg {
    width: 40px;
    height: 40px;
    stroke: var(--asm-primary);
}

/* Status 3D */
.asm-status-3d {
    display: inline-flex;
    align-items: center;
    padding: 8px 20px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.asm-status-pulse {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--status-color);
    margin-right: 10px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 var(--status-color);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

/* 3D Progress Bar */
.asm-3d-progress {
    margin: 20px 0;
}

.asm-progress-track {
    height: 30px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    transform-style: preserve-3d;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
}

.asm-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--asm-primary), var(--asm-secondary));
    position: relative;
    overflow: hidden;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.asm-progress-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
    animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Location Tags */
.asm-location-tags {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.asm-tag {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    backdrop-filter: blur(5px);
    font-size: 14px;
}

.asm-tag-arrow {
    color: var(--asm-primary);
    font-size: 20px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(5px); }
}

/* 3D Map */
.asm-3d-map {
    height: 400px;
    border-radius: 20px;
    overflow: hidden;
    transform-style: preserve-3d;
    transition: transform 0.3s;
    margin: 20px 0;
}

.asm-3d-map:hover {
    transform: rotateX(5deg) translateZ(20px);
}

/* Flip Cards */
.asm-split-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 30px 0;
}

.asm-flip-card {
    background: transparent;
    width: 100%;
    height: 200px;
    perspective: 2000px;
}

.asm-flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.asm-flip-card:hover .asm-flip-inner {
    transform: rotateY(180deg);
}

.asm-flip-front, .asm-flip-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.asm-flip-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
}

/* Details Grid */
.asm-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.asm-detail-item {
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(5px);
    transition: transform 0.3s;
}

.asm-detail-item:hover {
    transform: translateY(-3px) translateZ(10px);
}

.asm-detail-label {
    display: block;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.5);
    margin-bottom: 5px;
}

.asm-detail-value {
    font-weight: 600;
    color: var(--asm-dark);
}

/* 3D Gallery */
.asm-3d-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.asm-gallery-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    transform-style: preserve-3d;
    transition: transform 0.3s;
    cursor: pointer;
}

.asm-gallery-item:hover {
    transform: translateY(-5px) rotateX(5deg) translateZ(20px);
}

.asm-gallery-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.asm-gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.asm-gallery-item:hover .asm-gallery-overlay {
    opacity: 1;
}

/* 3D Timeline */
.asm-3d-timeline {
    position: relative;
    padding-left: 50px;
    margin: 30px 0;
}

.asm-3d-timeline::before {
    content: '';
    position: absolute;
    left: 24px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, 
        var(--asm-primary), 
        var(--asm-secondary), 
        var(--asm-primary));
}

.asm-timeline-item {
    position: relative;
    margin-bottom: 30px;
    transform-style: preserve-3d;
    transition: transform 0.3s;
}

.asm-timeline-item:hover {
    transform: translateX(5px) translateZ(10px);
}

.asm-timeline-dot {
    position: absolute;
    left: -44px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--timeline-color);
    border: 3px solid white;
    z-index: 1;
}

.asm-dot-pulse {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    animation: timeline-pulse 2s infinite;
}

@keyframes timeline-pulse {
    0% {
        box-shadow: 0 0 0 0 var(--timeline-color);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

.asm-timeline-item.latest .asm-timeline-dot {
    animation: latest-pulse 1.5s infinite;
}

@keyframes latest-pulse {
    0% {
        box-shadow: 0 0 0 0 var(--timeline-color);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(255, 255, 255, 0.3);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

.asm-timeline-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    border-left: 4px solid var(--timeline-color);
}

.asm-timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.asm-timeline-status {
    font-weight: 700;
    color: var(--timeline-color);
}

.asm-timeline-time {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.5);
}

/* Shipments Grid */
.asm-shipments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.asm-3d-shipment-card {
    perspective: 2000px;
    height: 400px;
}

.asm-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    cursor: pointer;
}

.asm-3d-shipment-card:hover .asm-card-inner {
    transform: rotateY(10deg) rotateX(5deg);
}

.asm-card-front {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
}

.asm-card-header {
    padding: 20px;
    color: white;
}

.asm-card-tracking {
    font-size: 14px;
    opacity: 0.9;
    display: block;
    margin-bottom: 5px;
}

.asm-card-status {
    font-size: 18px;
    font-weight: 700;
    display: block;
}

.asm-card-body {
    flex: 1;
    padding: 20px;
}

.asm-card-locations {
    margin-bottom: 20px;
}

.asm-location {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 14px;
}

.asm-location-arrow {
    text-align: center;
    margin: 5px 0;
    color: var(--asm-primary);
}

.asm-card-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
}

.asm-progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.asm-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--asm-primary), var(--asm-secondary));
}

.asm-card-meta {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    font-size: 12px;
}

.asm-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: rgba(0, 0, 0, 0.6);
}

.asm-card-footer {
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.asm-card-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: linear-gradient(135deg, var(--asm-primary), var(--asm-secondary));
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s;
}

.asm-card-button:hover {
    transform: translateY(-2px) translateZ(10px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

/* Empty State */
.asm-empty-state {
    text-align: center;
    padding: 60px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 30px;
}

.asm-empty-state svg {
    stroke: var(--asm-primary);
    margin-bottom: 20px;
}

.asm-empty-state h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.asm-empty-state p {
    color: rgba(0, 0, 0, 0.6);
}

/* Responsive */
@media (max-width: 768px) {
    .asm-split-cards {
        grid-template-columns: 1fr;
    }
    
    .asm-features {
        grid-template-columns: 1fr;
    }
    
    .asm-shipments-grid {
        grid-template-columns: 1fr;
    }
    
    .asm-details-grid {
        grid-template-columns: 1fr;
    }
    
    .asm-3d-map {
        height: 300px;
    }
}

/* 3D Effects on Scroll */
.asm-3d-container {
    animation: fadeIn 1s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(50px) rotateX(-10deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}