:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #22c55e;
    --background: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Vazirmatn", sans-serif;
}

body {
    background: var(--background);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

.tracking-form {
    background: var(--surface);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUp 0.5s ease forwards;
}

.input-group {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.input-wrapper {
    flex: 1;
    position: relative;
}

input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.captcha-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.captcha-wrapper {
    position: relative;
    width: 150px;
    height: 50px;
}

#captchaCanvas {
    border-radius: 0.5rem;
    cursor: pointer;
}

.refresh-captcha {
    position: absolute;
    left: 40%;
    top: 100%;
    transform: translateY(-50%);
    background: var(--primary);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.refresh-captcha:hover {
    background: var(--primary-dark);
    transform: translateY(-50%) rotate(180deg);
}

.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.tracking-results {
    display: none;
    opacity: 0;
    transform: translateY(20px);
}

.tracking-results.active {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    animation: slideUp 0.5s ease forwards;
}

.map-container {
    background: var(--surface);
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

#map {
    height: 400px;
    border-radius: 0.5rem;
}

.tracking-details {
    background: var(--surface);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    display: flex;
    flex-direction: column;
    height: auto;
    opacity: 1;
}

.status-timeline {
    position: relative;
    padding-right: 2rem;
    opacity: 1;
}

.timeline-item {
    position: relative;
    padding-right: 2rem;
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateX(20px);
}

.timeline-item.active {
    animation: slideRight 0.5s ease forwards;
}

.timeline-item::before {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
}

.timeline-item::after {
    content: "";
    position: absolute;
    right: -4px;
    top: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 0.5rem;
    transition: transform 0.3s ease;
}

.info-item:hover {
    transform: translateY(-2px);
}

.info-item i {
    font-size: 1.5rem;
    color: var(--primary);
}

.info-item h4 {
    margin: 0;
    color: var(--secondary);
    font-size: 0.875rem;
}

.info-item p {
    margin: 0.25rem 0 0;
    font-weight: 500;
}

.timeline-content {
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-right: 1rem;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-badge.success {
    background: #dcfce7;
    color: #166534;
}

.status-badge.info {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge.warning {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.primary {
    background: #e0f2fe;
    color: #0369a1;
}

.loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
}

.loader::after {
    content: "";
    width: 30px;
    height: 30px;
    border: 3px solid var(--primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.custom-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.5rem;
    animation: bounce 1s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.tracking-details.for-download {
    height: auto !important;
    overflow: visible !important;
    position: static !important;
    transform: none !important;
}

.tracking-details.for-download .status-timeline {
    max-height: none !important;
    overflow: visible !important;
    height: auto !important;
    opacity: 1 !important;
}

.tracking-details.for-download .timeline-item {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
}

/* Add/update these responsive styles */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .input-group {
        flex-direction: column;
        gap: 1.5rem;
    }

    .captcha-container {
        width: 100%;
        flex-direction: column;
        align-items: center;
    }

    .tracking-results.active {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    #map {
        height: 300px;
    }

    .tracking-form {
        padding: 1rem;
    }

    .tracking-details {
        padding: 1rem;
    }

    .timeline-content {
        padding: 0.75rem;
        margin-right: 0.75rem;
    }

    .status-badge {
        font-size: 0.75rem;
        padding: 0.2rem 0.5rem;
    }
}

/* Add styles for signature container */
.signature-container {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    text-align: center;
}

.signature-container img {
    max-width: 200px;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.5rem;
    background: white;
    display: inline-block;
}

/* Add after the root variables and before the body styles */
.page-title {
    text-align: center;
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUp 0.5s ease forwards;
}

.page-title h1 {
    color: var(--text);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.page-title p {
    color: var(--secondary);
    font-size: 1.1rem;
}

/* Add to the existing media queries for responsive design */
@media (max-width: 768px) {
    .page-title {
        margin-bottom: 1.5rem;
    }

    .page-title h1 {
        font-size: 1.5rem;
    }

    .page-title p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .page-title h1 {
        font-size: 1.25rem;
    }

    .page-title p {
        font-size: 0.9rem;
    }
}