/* ============================================
   LASTIK LOJISTIK - Components Stylesheet
   Reusable UI Components
============================================ */

/* ============================================
   BUTTONS
============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width var(--transition-base), height var(--transition-base);
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--dark-gray);
    border: 2px solid var(--light-gray);
}

.btn-outline:hover {
    background: var(--off-white);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

.btn-success:hover {
    background: #218838;
    box-shadow: var(--shadow-md);
}

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

.btn-danger:hover {
    background: #c82333;
    box-shadow: var(--shadow-md);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ============================================
   FORM ELEMENTS
============================================ */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: var(--font-weight-medium);
    color: var(--dark-gray);
}

.form-label.required::after {
    content: ' *';
    color: var(--error);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--light-gray);
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: 1rem;
    color: var(--dark-gray);
    background: var(--white);
    transition: all var(--transition-base);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.form-input::placeholder {
    color: var(--gray);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-error {
    display: block;
    margin-top: var(--spacing-xs);
    color: var(--error);
    font-size: 0.875rem;
}

.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: var(--error);
}

/* ============================================
   CARDS
============================================ */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-lg);
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.card-header {
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--light-gray);
}

.card-title {
    font-size: 1.25rem;
    font-weight: var(--font-weight-semibold);
    color: var(--dark-gray);
    margin: 0;
}

.card-body {
    color: var(--gray);
}

.card-footer {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--light-gray);
}

/* Service Cards with Icons */
.service-card {
    text-align: center;
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    border: 2px solid transparent;
}

.service-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-xl);
    transform: translateY(-10px);
}

.service-card-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-md);
    background: var(--primary-gradient);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--white);
    box-shadow: var(--shadow-glow);
}

.service-card h3 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
    color: var(--dark-gray);
}

.service-card p {
    color: var(--gray);
    font-size: 0.95rem;
}

/* New Service Cards with Gradient */
.service-card-new {
    transition: all var(--transition-base);
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.service-card-new:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.service-card-top {
    border-radius: 12px 12px 0 0;
    padding: 3rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    position: relative;
    overflow: hidden;
}

.service-bg-icon {
    position: absolute;
    right: -30px;
    bottom: -30px;
    width: 180px;
    height: 180px;
    opacity: 0.15;
    filter: brightness(0) invert(1);
    transform: rotate(-15deg);
}

.service-main-icon {
    width: 100px;
    height: 100px;
    filter: brightness(0) invert(1);
    position: relative;
    z-index: 10;
    transition: all var(--transition-base);
}

.service-card-new:hover .service-main-icon {
    transform: scale(1.15) rotate(5deg);
}

.service-card-bottom {
    background: var(--white);
    padding: 2rem 1.5rem;
    border-radius: 0 0 12px 12px;
    text-align: center;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.service-card-bottom h3 {
    font-size: 1.35rem;
    font-weight: var(--font-weight-bold);
    color: var(--dark-gray);
    margin-bottom: 0.75rem;
}

.service-card-bottom p {
    color: var(--gray);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

/* Glassmorphism Card */
.card-glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-xl);
}

/* ============================================
   MODALS
============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

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

.modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: all var(--transition-base);
}

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

.modal-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: var(--font-weight-semibold);
    margin: 0;
    color: var(--dark-gray);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
    transition: color var(--transition-fast);
    padding: var(--spacing-xs);
    line-height: 1;
}

.modal-close:hover {
    color: var(--error);
}

.modal-body {
    padding: var(--spacing-lg);
}

.modal-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--light-gray);
    display: flex;
    gap: var(--spacing-sm);
    justify-content: flex-end;
}

/* ============================================
   ALERTS & NOTIFICATIONS
============================================ */
.alert {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    animation: slideInRight var(--transition-base);
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid var(--success);
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--error);
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid var(--warning);
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid var(--info);
}

/* Toast Notification */
.toast {
    position: fixed;
    top: calc(var(--header-height) + var(--spacing-md));
    right: var(--spacing-md);
    min-width: 300px;
    z-index: 10000;
    animation: slideInRight var(--transition-base);
}

/* ============================================
   TABLES
============================================ */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-lg);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}

.table thead {
    background: var(--primary-gradient);
    color: var(--white);
}

.table th {
    padding: var(--spacing-md);
    text-align: left;
    font-weight: var(--font-weight-semibold);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table td {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--light-gray);
    color: var(--dark-gray);
}

.table tbody tr {
    transition: background var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--off-white);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================
   BADGES & TAGS
============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: var(--font-weight-semibold);
}

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

.badge-success {
    background: var(--success);
    color: var(--white);
}

.badge-warning {
    background: var(--warning);
    color: var(--black);
}

.badge-error {
    background: var(--error);
    color: var(--white);
}

.badge-secondary {
    background: var(--light-gray);
    color: var(--dark-gray);
}

/* ============================================
   GRID LAYOUTS
============================================ */
.grid {
    display: grid;
    gap: var(--spacing-lg);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    /* Table responsive */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        min-width: 600px;
    }

    .table th,
    .table td {
        padding: var(--spacing-sm);
        font-size: 0.875rem;
    }

    /* Tabs responsive */
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: var(--spacing-md);
    }

    .tabs-list {
        display: flex;
        gap: var(--spacing-sm);
        min-width: min-content;
        padding-bottom: var(--spacing-xs);
    }

    .tab-item {
        white-space: nowrap;
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.9rem;
    }

    /* Panel section spacing */
    .section[style*="margin-top"] {
        padding-top: var(--spacing-md) !important;
    }

    /* Modal responsive */
    .modal {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: var(--spacing-md);
    }

    /* Card responsive */
    .card {
        padding: var(--spacing-md);
    }

    /* Service cards */
    .service-card {
        padding: var(--spacing-lg);
    }
}

@media (max-width: 480px) {
    .table {
        min-width: 500px;
    }

    .table th,
    .table td {
        padding: var(--spacing-xs);
        font-size: 0.8rem;
    }

    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.9rem;
    }

    .btn-sm {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* ============================================
   LOADING SPINNER
============================================ */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--light-gray);
    border-top-color: var(--primary-color);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
}

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

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

/* ============================================
   BREADCRUMB
============================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-lg);
    color: var(--gray);
    font-size: 0.95rem;
}

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

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

.breadcrumb-separator {
    color: var(--gray);
}

/* ============================================
   PAGINATION
============================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    margin: var(--spacing-xl) 0;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--light-gray);
    background: var(--white);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    color: var(--dark-gray);
    font-weight: var(--font-weight-medium);
}

.pagination-btn:hover:not(.active):not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination-btn.active {
    background: var(--primary-gradient);
    color: var(--white);
    border-color: transparent;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   TABS
============================================ */
.tabs {
    border-bottom: 2px solid var(--light-gray);
    margin-bottom: var(--spacing-lg);
}

.tabs-list {
    display: flex;
    gap: var(--spacing-md);
    list-style: none;
}

.tab-item {
    padding: var(--spacing-md) var(--spacing-lg);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    color: var(--gray);
    font-weight: var(--font-weight-medium);
    transition: all var(--transition-base);
    margin-bottom: -2px;
}

.tab-item:hover {
    color: var(--primary-color);
}

.tab-item.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
    animation: fadeIn var(--transition-base);
}

.tab-content.active {
    display: block;
}