/*
 * Style arkusza stylów (CSS) dla aplikacji DHL Express BPI Integration
 * Premium Dark Mode, Glassmorphism, Responsive Design
 */

:root {
    --bg-color: #0c0c0e;
    --card-bg: rgba(22, 22, 26, 0.75);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-border-focus: rgba(255, 204, 0, 0.3);
    
    --text-primary: #ffffff;
    --text-secondary: #a0a0a5;
    
    /* Zmodernizowane barwy DHL */
    --dhl-yellow: #ffcc00;
    --dhl-red: #d30111;
    --dhl-yellow-hover: #e6b800;
    
    --error-color: #ff4d4d;
    --error-bg: rgba(255, 77, 77, 0.1);
    --error-border: rgba(255, 77, 77, 0.2);
    
    --success-color: #00e676;
    --success-bg: rgba(0, 230, 118, 0.1);
    --success-border: rgba(0, 230, 118, 0.2);
    
    --input-bg: rgba(30, 30, 35, 0.6);
    --input-border: rgba(255, 255, 255, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
}

/* Dekoracyjne świecące tła (Mesh Gradients) */
.glow-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.45;
    animation: pulse 12s infinite alternate ease-in-out;
}

.shape-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--dhl-yellow) 0%, transparent 70%);
}

.shape-2 {
    bottom: -10%;
    right: -10%;
    width: 55vw;
    height: 55vw;
    background: radial-gradient(circle, var(--dhl-red) 0%, transparent 70%);
    animation-delay: -6s;
}

@keyframes pulse {
    0% {
        transform: translate(0, 0) scale(1);
    }
    100% {
        transform: translate(50px, 30px) scale(1.15);
    }
}

/* Kontener główny - zwiększony do obsługi widoku hurtowego */
.container {
    width: 100%;
    max-width: 680px;
    padding: 20px;
    z-index: 1;
}

/* Karta Szklana (Glassmorphism) */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.card:hover {
    border-color: rgba(255, 204, 0, 0.15);
}

.login-card {
    max-width: 440px;
    margin: 0 auto;
}

.dashboard-card {
    max-width: 640px;
    margin: 0 auto;
}

/* Nagłówek */
.logo-area {
    text-align: center;
    margin-bottom: 35px;
}

.dhl-logo {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--dhl-yellow);
    letter-spacing: -1.5px;
    display: inline-block;
}

.dhl-logo span {
    color: var(--dhl-red);
    font-style: italic;
    font-weight: 900;
    font-size: 1.8rem;
    margin-left: 2px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 6px;
}

/* Zakładki (Tabs) */
.tabs-container {
    display: flex;
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 25px;
    gap: 10px;
}

.tab-link {
    background: none;
    border: none;
    padding: 12px 20px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

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

.tab-link.active {
    color: var(--dhl-yellow);
    border-bottom-color: var(--dhl-yellow);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease forwards;
}

/* Formularze */
.form-group {
    margin-bottom: 24px;
    position: relative;
}

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 14px 18px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="password"]:focus {
    border-color: var(--dhl-yellow);
    box-shadow: 0 0 0 3px var(--card-border-focus);
    background-color: rgba(30, 30, 35, 0.8);
}

input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Pole Textarea (Batch AWB) */
textarea {
    width: 100%;
    padding: 15px;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: monospace;
    font-size: 0.95rem;
    resize: vertical;
    outline: none;
    transition: all 0.3s ease;
    line-height: 1.5;
}

textarea:focus {
    border-color: var(--dhl-yellow);
    box-shadow: 0 0 0 3px var(--card-border-focus);
    background-color: rgba(30, 30, 35, 0.8);
}

.textarea-footer {
    display: flex;
    justify-content: flex-end;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 6px;
}

.textarea-footer strong {
    color: var(--dhl-yellow);
    margin-left: 4px;
}

/* Panel główny AWB input */
.awb-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.awb-input-wrapper input {
    letter-spacing: 4px;
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    padding-right: 70px;
}

.char-counter {
    position: absolute;
    right: 18px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0px;
    pointer-events: none;
}

/* Przyciski */
.btn {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--dhl-yellow) 0%, #e6b800 100%);
    color: #000000;
    box-shadow: 0 4px 15px rgba(255, 204, 0, 0.25);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 204, 0, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

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

.btn-large {
    padding: 18px 28px;
    font-size: 1.1rem;
    margin-top: 15px;
}

/* Przycisk Wyloguj */
.btn-logout {
    padding: 8px 16px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background-color: var(--dhl-red);
    border-color: var(--dhl-red);
    box-shadow: 0 4px 12px rgba(211, 1, 17, 0.3);
}

/* Panel użytkownika w nagłówku */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 24px;
    margin-bottom: 30px;
}

.dashboard-header .logo-area {
    text-align: left;
    margin-bottom: 0;
}

.user-menu {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.timeout-counter {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    background-color: rgba(255, 255, 255, 0.04);
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.timeout-counter span {
    color: var(--dhl-yellow);
    font-family: monospace;
    font-size: 0.85rem;
}

/* Zawartość Dashboardu */
.dashboard-content h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.3px;
}

.dashboard-content .description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.dashboard-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--card-border);
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
}

.dashboard-footer strong {
    color: var(--text-primary);
}

/* Alerty / Statusy */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 24px;
    text-align: center;
}

.alert-info {
    background-color: rgba(255, 204, 0, 0.08);
    border: 1px solid rgba(255, 204, 0, 0.2);
    color: var(--dhl-yellow);
}

.alert-danger {
    background-color: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error-color);
}

/* Wskazówka informacyjna (Batch) */
.info-note {
    background-color: rgba(255, 204, 0, 0.05);
    border: 1px solid rgba(255, 204, 0, 0.12);
    color: #ffd83d;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    margin-bottom: 24px;
    line-height: 1.4;
    text-align: left;
}

/* Wiadomości walidacji */
.validation-msg {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 6px;
    transition: color 0.3s ease;
}

.validation-msg.error {
    color: var(--error-color);
}

.validation-msg.success {
    color: var(--success-color);
}

/* Box statusu pobierania (AJAX pojedynczy) */
.status-box {
    margin-top: 25px;
    padding: 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.status-box.hidden {
    display: none;
}

.status-box.success {
    background-color: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success-color);
}

.status-box.error {
    background-color: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error-color);
}

.status-message strong {
    font-weight: 700;
}

/* Pasek postępu pobierania hurtowego */
.batch-progress-area {
    margin-top: 30px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 16px;
}

.batch-progress-area.hidden {
    display: none;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--dhl-yellow) 0%, #e6b800 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Tabela statusów pobierania hurtowego */
.batch-status-list {
    margin-top: 25px;
    text-align: left;
}

.batch-status-list.hidden {
    display: none;
}

.batch-status-list h3 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.list-container {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    background-color: rgba(0, 0, 0, 0.2);
}

/* Pojedynczy wiersz statusu hurtowego */
.batch-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.batch-row:last-child {
    border-bottom: none;
}

.batch-row .awb-num {
    font-weight: 700;
    font-family: monospace;
    font-size: 1rem;
    letter-spacing: 1px;
}

.batch-row .awb-status-text {
    flex-grow: 1;
    text-align: right;
    margin-right: 15px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.batch-row .awb-status-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 20px;
    height: 20px;
}

/* Stany wierszy */
.batch-row.pending {
    opacity: 0.5;
}

.batch-row.processing {
    background-color: rgba(255, 204, 0, 0.03);
}

.batch-row.processing .awb-status-text {
    color: var(--dhl-yellow);
}

.batch-row.success {
    background-color: rgba(0, 230, 118, 0.02);
}

.batch-row.success .awb-num {
    color: var(--success-color);
}

.batch-row.success .awb-status-text {
    color: var(--success-color);
}

.batch-row.error {
    background-color: rgba(255, 77, 77, 0.02);
}

.batch-row.error .awb-num {
    color: var(--error-color);
}

.batch-row.error .awb-status-text {
    color: var(--error-color);
}

/* Stylizacja statusów kolorowych */
.text-success {
    color: var(--success-color) !important;
}

.text-error {
    color: var(--error-color) !important;
}

/* Spinny ładowania */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.15);
    border-radius: 50%;
    border-top-color: #000000;
    animation: spin 0.8s linear infinite;
    display: none;
}

.spinner-small {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 204, 0, 0.2);
    border-radius: 50%;
    border-top-color: var(--dhl-yellow);
    animation: spin 0.8s linear infinite;
}

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

/* Animacje wejścia */
.animate-fade-in {
    animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-slide-in {
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

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

/* Stylizacja scrollbara dla kontenera statusów */
.list-container::-webkit-scrollbar {
    width: 6px;
}

.list-container::-webkit-scrollbar-track {
    background: transparent;
}

.list-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.list-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Responsywność */
@media (max-width: 480px) {
    .card {
        padding: 24px 20px;
        border-radius: 16px;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        text-align: center;
    }
    
    .dashboard-header .logo-area {
        text-align: center;
    }
    
    .user-menu {
        align-items: center;
    }
    
    .awb-input-wrapper input {
        font-size: 1.2rem;
        padding-right: 60px;
    }
    
    .dhl-logo {
        font-size: 1.8rem;
    }
    
    .tabs-container {
        flex-direction: column;
        gap: 5px;
    }
    
    .tab-link {
        text-align: center;
        border-bottom: none;
        border-left: 3px solid transparent;
        padding: 10px;
    }
    
    .tab-link.active {
        border-left-color: var(--dhl-yellow);
        background-color: rgba(255, 255, 255, 0.02);
    }
    
    .batch-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .batch-row .awb-status-text {
        text-align: left;
        margin-right: 0;
    }
}
