/* CSS Variables for design consistency */
:root {
    --tcs-primary: #d32f2f; /* Premium TCS Red */
    --tcs-primary-hover: #b71c1c;
    --tcs-success: #10b981; /* Emerald Green */
    --tcs-text-main: #1e293b; /* Slate 800 */
    --tcs-text-muted: #64748b; /* Slate 500 */
    --tcs-bg-card: #ffffff;
    --tcs-bg-light: #f8fafc; /* Slate 50 */
    --tcs-border: #e2e8f0; /* Slate 200 */
    --tcs-radius: 12px;
    --tcs-radius-sm: 8px;
    --tcs-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.04);
    --tcs-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

/* Base Wrapper styles */
.tcs-wrapper {
    font-family: var(--tcs-font);
    color: var(--tcs-text-main);
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
    box-sizing: border-box;
    line-height: 1.5;
}

.tcs-wrapper * {
    box-sizing: border-box;
}

/* Card Styling */
.tcs-card {
    background: var(--tcs-bg-card);
    border-radius: var(--tcs-radius);
    padding: 30px;
    box-shadow: var(--tcs-shadow);
    border: 1px solid var(--tcs-border);
    margin-bottom: 25px;
    position: relative;
    transition: transform 0.2s ease;
}

.tcs-card-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 5px 0;
    color: var(--tcs-text-main);
}

.tcs-card-sub {
    font-size: 14px;
    color: var(--tcs-text-muted);
    margin: 0 0 25px 0;
}

/* Inputs & Form Controls */
.tcs-form-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.tcs-form-group label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--tcs-text-main);
}

.tcs-form-group input[type="text"],
.tcs-form-group input[type="number"] {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    border: 1px solid var(--tcs-border);
    border-radius: var(--tcs-radius-sm);
    background: var(--tcs-bg-light);
    outline: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--tcs-text-main);
}

.tcs-form-group input:focus {
    border-color: var(--tcs-primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

/* Buttons */
.tcs-btn {
    background-color: var(--tcs-primary);
    color: #ffffff !important;
    border: none;
    border-radius: var(--tcs-radius-sm);
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tcs-btn:hover {
    background-color: var(--tcs-primary-hover);
    transform: translateY(-1px);
}

.tcs-btn:active {
    transform: translateY(0);
}

/* Grid layout for rate calculator */
.tcs-calc-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 600px) {
    .tcs-calc-grid {
        grid-template-columns: 2fr 2fr 1fr;
    }
}

/* Autocomplete city dropdown container */
.tcs-dropdown-wrapper {
    position: relative;
    width: 100%;
}

.tcs-city-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid var(--tcs-border);
    border-radius: var(--tcs-radius-sm);
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    max-height: 250px;
    overflow-y: auto;
    z-index: 9999;
    margin-top: 5px;
}

.tcs-city-item {
    padding: 10px 15px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    border-bottom: 1px solid #f1f5f9;
}

.tcs-city-item:last-child {
    border-bottom: none;
}

.tcs-city-item:hover {
    background-color: var(--tcs-bg-light);
}

.tcs-city-item strong {
    color: var(--tcs-primary);
}

/* Loader / Spinner */
.tcs-loader-container {
    text-align: center;
    padding: 40px;
    background: var(--tcs-bg-card);
    border-radius: var(--tcs-radius);
    border: 1px solid var(--tcs-border);
    box-shadow: var(--tcs-shadow);
    margin-bottom: 25px;
}

.tcs-loader-container p {
    margin: 15px 0 0 0;
    font-size: 14px;
    color: var(--tcs-text-muted);
}

.tcs-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(211, 47, 47, 0.1);
    border-top: 3px solid var(--tcs-primary);
    border-radius: 50%;
    animation: tcs-spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes tcs-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error messages */
.tcs-error {
    background-color: #fef2f2;
    border-left: 4px solid #ef4444;
    color: #b91c1c;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
}

/* Results containers */
.tcs-result-container {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tracking results cards */
.tcs-summary-card {
    background: var(--tcs-bg-card);
    border-radius: var(--tcs-radius);
    padding: 24px;
    box-shadow: var(--tcs-shadow);
    border: 1px solid var(--tcs-border);
    margin-bottom: 20px;
}

.tcs-summary-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 500px) {
    .tcs-summary-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.tcs-summary-grid div {
    font-size: 14px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 8px;
}

.tcs-summary-grid div:last-child {
    border-bottom: none;
}

.tcs-summary-grid span {
    color: var(--tcs-text-muted);
    margin-left: 5px;
}

.tcs-timeline-card, .tcs-table-card {
    background: var(--tcs-bg-card);
    border-radius: var(--tcs-radius);
    padding: 30px;
    box-shadow: var(--tcs-shadow);
    border: 1px solid var(--tcs-border);
}

.tcs-timeline-card h4, .tcs-table-card h4 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 20px 0;
}

/* Timeline/Stepper styles */
.tcs-timeline {
    position: relative;
    padding-left: 30px;
    margin-left: 10px;
    border-left: 2px solid var(--tcs-border);
}

.tcs-timeline-step {
    position: relative;
    margin-bottom: 25px;
}

.tcs-timeline-step:last-child {
    margin-bottom: 0;
}

.tcs-timeline-dot {
    position: absolute;
    left: -41px;
    top: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    border: 4px solid var(--tcs-border);
    transition: all 0.3s ease;
}

.tcs-timeline-step.completed .tcs-timeline-dot {
    border-color: var(--tcs-success);
    background: var(--tcs-success);
}

.tcs-timeline-step.active .tcs-timeline-dot {
    border-color: var(--tcs-primary);
    background: var(--tcs-primary);
    box-shadow: 0 0 0 5px rgba(211, 47, 47, 0.15);
}

.tcs-timeline-content {
    background: var(--tcs-bg-light);
    border-radius: var(--tcs-radius-sm);
    padding: 15px 20px;
    border: 1px solid var(--tcs-border);
    transition: transform 0.2s ease;
}

.tcs-timeline-content:hover {
    transform: translateX(3px);
}

.tcs-timeline-status {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
}

.tcs-timeline-meta {
    font-size: 12px;
    color: var(--tcs-text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.tcs-timeline-meta span strong {
    color: var(--tcs-text-main);
}

/* Tables style for rates */
.tcs-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.tcs-table th, .tcs-table td {
    padding: 14px 16px;
    text-align: left;
    font-size: 14px;
    border-bottom: 1px solid var(--tcs-border);
}

.tcs-table th {
    font-weight: 700;
    color: var(--tcs-text-muted);
    background-color: var(--tcs-bg-light);
}

.tcs-table tbody tr:hover {
    background-color: var(--tcs-bg-light);
}

.tcs-table td strong {
    color: var(--tcs-primary);
}

.tcs-note {
    font-size: 12px;
    color: var(--tcs-text-muted);
    margin-top: 15px;
    font-style: italic;
}

/* Layout for forms inline */
@media (min-width: 500px) {
    .tcs-tracking-wrapper .tcs-form-group {
        flex-direction: row;
        gap: 10px;
    }
    
    .tcs-tracking-wrapper .tcs-form-group input {
        flex: 1;
        margin-bottom: 0;
    }
}
