/* ============================================
   PANEL STYLES - Asystent Przetargowy
   ============================================ */

/* === ZMIENNE === */
:root {
    --ap-primary: #2563eb;
    --ap-primary-hover: #1d4ed8;
    --ap-primary-light: #dbeafe;
    --ap-success: #10b981;
    --ap-success-light: #d1fae5;
    --ap-warning: #f59e0b;
    --ap-warning-light: #fef3c7;
    --ap-error: #ef4444;
    --ap-error-light: #fee2e2;
    --ap-text: #1f2937;
    --ap-text-light: #6b7280;
    --ap-text-muted: #9ca3af;
    --ap-border: #e5e7eb;
    --ap-bg: #f9fafb;
    --ap-white: #ffffff;
    --ap-sidebar-bg: #1e293b;
    --ap-sidebar-hover: #334155;
    --ap-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --ap-shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --ap-radius: 12px;
    --ap-radius-sm: 8px;
    --ap-transition: all 0.3s ease;
}

/* === RESET === */
.ap-panel-wrapper * {
    box-sizing: border-box;
}

/* === GŁÓWNY KONTENER === */
.ap-panel-wrapper {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
    background: var(--ap-bg);
    gap: 0;
    margin: -40px -20px;
    padding: 0;
}

/* === SIDEBAR === */
.ap-panel-sidebar {
    background: linear-gradient(180deg, var(--ap-sidebar-bg) 0%, #0f172a 100%);
    color: var(--ap-white);
    padding: 2rem 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.ap-panel-user-info {
    text-align: center;
    padding: 0 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
}

.ap-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--ap-primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.ap-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ap-panel-user-info h3 {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ap-white);
}

.ap-user-email {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 1rem;
}

.ap-badge {
    display: inline-block;
    padding: 0.375rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ap-badge-basic {
    background: rgba(107, 114, 128, 0.2);
    color: #d1d5db;
}

.ap-badge-pro {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--ap-white);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.ap-badge-gradient {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: var(--ap-white);
}

/* === NAWIGACJA === */
.ap-panel-nav {
    padding: 0 1rem;
}

.ap-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: var(--ap-radius-sm);
    transition: var(--ap-transition);
    font-size: 0.95rem;
    font-weight: 500;
}

.ap-nav-item:hover {
    background: var(--ap-sidebar-hover);
    color: var(--ap-white);
    transform: translateX(3px);
}

.ap-nav-item.active {
    background: var(--ap-primary);
    color: var(--ap-white);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.ap-nav-item .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.ap-nav-item.ap-logout {
    margin-top: 2rem;
    color: rgba(239, 68, 68, 0.9);
}

.ap-nav-item.ap-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--ap-error);
}

/* === CONTENT AREA === */
.ap-panel-content {
    padding: 2.5rem 3rem;
    background: var(--ap-bg);
    min-height: 100vh;
}

.ap-panel-header {
    margin-bottom: 2rem;
}

.ap-panel-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--ap-text);
    margin: 0 0 0.5rem;
}

.ap-panel-header p {
    color: var(--ap-text-light);
    font-size: 1rem;
    margin: 0;
}

/* === ALERTY === */
.ap-alert {
    padding: 1.25rem 1.5rem;
    border-radius: var(--ap-radius);
    margin-bottom: 2rem;
    border-left: 4px solid;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ap-alert strong {
    font-weight: 600;
    font-size: 1.05rem;
}

.ap-alert p {
    margin: 0;
    font-size: 0.95rem;
}

.ap-alert-info {
    background: var(--ap-primary-light);
    border-color: var(--ap-primary);
    color: var(--ap-text);
}

.ap-alert-warning {
    background: var(--ap-warning-light);
    border-color: var(--ap-warning);
    color: #92400e;
}

.ap-alert-success {
    background: var(--ap-success-light);
    border-color: var(--ap-success);
    color: #065f46;
}

/* === DASHBOARD CARDS === */
.ap-dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.ap-card {
    background: var(--ap-white);
    border-radius: var(--ap-radius);
    padding: 1.75rem;
    box-shadow: var(--ap-shadow);
    transition: var(--ap-transition);
    position: relative;
    overflow: hidden;
}

.ap-card:hover {
    box-shadow: var(--ap-shadow-lg);
    transform: translateY(-4px);
}

.ap-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: linear-gradient(135deg, var(--ap-primary) 0%, #3b82f6 100%);
}

.ap-card-icon.ap-icon-profile {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.ap-card-icon.ap-icon-settings {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.ap-card-icon.ap-icon-chart {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.ap-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ap-text);
    margin: 0 0 1rem;
}

.ap-card p {
    color: var(--ap-text-light);
    font-size: 0.95rem;
    margin: 0 0 1rem;
}

.ap-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.ap-status-success {
    background: var(--ap-success-light);
    color: #065f46;
}

.ap-status-warning {
    background: var(--ap-warning-light);
    color: #92400e;
}

.ap-stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--ap-primary);
    margin: 1rem 0 0.5rem;
}

.ap-text-muted {
    color: var(--ap-text-muted);
}

/* === MESSAGES === */
.ap-message {
    padding: 1rem 1.25rem;
    border-radius: var(--ap-radius-sm);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    border-left: 4px solid;
}

.ap-message.ap-success {
    background: var(--ap-success-light);
    color: #065f46;
    border-color: var(--ap-success);
}

.ap-message.ap-error {
    background: var(--ap-error-light);
    color: #991b1b;
    border-color: var(--ap-error);
}

/* === FORMS === */
.ap-form-panel {
    background: var(--ap-white);
    border-radius: var(--ap-radius);
    padding: 2rem;
    box-shadow: var(--ap-shadow);
}

.ap-form-section {
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--ap-border);
}

.ap-form-section:last-of-type {
    border-bottom: none;
}

.ap-form-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ap-text);
    margin: 0 0 1.5rem;
}

.ap-form-help {
    color: var(--ap-text-light);
    font-size: 0.9rem;
    margin: 0 0 1rem;
}

.ap-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.ap-form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.25rem;
}

.ap-form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ap-text);
    margin-bottom: 0.5rem;
}

.ap-form-group input[type="text"],
.ap-form-group input[type="email"],
.ap-form-group input[type="tel"],
.ap-form-group input[type="url"],
.ap-form-group input[type="number"],
.ap-form-group input[type="password"],
.ap-form-group select,
.ap-form-group textarea {
    padding: 0.75rem 1rem;
    border: 2px solid var(--ap-border);
    border-radius: var(--ap-radius-sm);
    font-size: 1rem;
    transition: var(--ap-transition);
    background: var(--ap-white);
    color: var(--ap-text);
}

.ap-form-group input:focus,
.ap-form-group select:focus,
.ap-form-group textarea:focus {
    outline: none;
    border-color: var(--ap-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.ap-form-group small {
    font-size: 0.8rem;
    color: var(--ap-text-muted);
    margin-top: 0.375rem;
}

.ap-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* === CHECKBOXY === */
.ap-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.ap-checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--ap-bg);
    border: 2px solid var(--ap-border);
    border-radius: var(--ap-radius-sm);
    cursor: pointer;
    transition: var(--ap-transition);
}

.ap-checkbox-item:hover {
    border-color: var(--ap-primary);
    background: var(--ap-primary-light);
}

.ap-checkbox-item input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    cursor: pointer;
}

.ap-checkbox-item input[type="checkbox"]:checked + span {
    font-weight: 600;
    color: var(--ap-primary);
}

.ap-form-group.ap-checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-weight: 400;
    cursor: pointer;
}

/* === PRZYCISKI === */
.ap-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--ap-radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--ap-transition);
    text-align: center;
    text-decoration: none;
}

.ap-btn-primary {
    background: var(--ap-primary);
    color: var(--ap-white);
}

.ap-btn-primary:hover {
    background: var(--ap-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.ap-btn-outline {
    background: transparent;
    border: 2px solid var(--ap-border);
    color: var(--ap-text);
}

.ap-btn-outline:hover {
    border-color: var(--ap-primary);
    color: var(--ap-primary);
    background: var(--ap-primary-light);
}

.ap-btn-danger {
    background: var(--ap-error);
    color: var(--ap-white);
}

.ap-btn-danger:hover {
    background: #dc2626;
}

.ap-btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.ap-btn-large {
    padding: 1rem 2rem;
    font-size: 1.05rem;
}

.ap-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ap-form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* === PLAN CARDS === */
.ap-plan-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.ap-plan-card {
    background: var(--ap-white);
    border-radius: var(--ap-radius);
    padding: 2.5rem 2rem;
    box-shadow: var(--ap-shadow);
    transition: var(--ap-transition);
    position: relative;
    border: 2px solid transparent;
}

.ap-plan-card:hover {
    box-shadow: var(--ap-shadow-lg);
    transform: translateY(-8px);
}

.ap-plan-card.ap-plan-recommended {
    border-color: var(--ap-primary);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.2);
}

.ap-plan-card.ap-plan-active {
    border-color: var(--ap-success);
}

.ap-plan-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.375rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--ap-bg);
    color: var(--ap-text-muted);
}

.ap-plan-recommended .ap-plan-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--ap-white);
}

.ap-plan-price {
    margin: 2rem 0 1.5rem;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.ap-price-amount {
    font-size: 3rem;
    font-weight: 700;
    color: var(--ap-text);
}

.ap-price-currency {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ap-text-light);
}

.ap-price-period {
    font-size: 1rem;
    color: var(--ap-text-muted);
}

.ap-plan-features {
    list-style: none;
    padding: 0;
    margin: 2rem 0;
}

.ap-plan-features li {
    padding: 0.75rem 0;
    font-size: 0.95rem;
    color: var(--ap-text);
    border-bottom: 1px solid var(--ap-border);
}

.ap-plan-features li:last-child {
    border-bottom: none;
}

.ap-plan-info {
    text-align: center;
    color: var(--ap-text-muted);
    font-size: 0.85rem;
    margin-top: 1rem;
}

/* === SECTION === */
.ap-section {
    background: var(--ap-white);
    border-radius: var(--ap-radius);
    padding: 2rem;
    box-shadow: var(--ap-shadow);
    margin-bottom: 2rem;
}

.ap-section h2,
.ap-section h3 {
    margin-top: 0;
}

/* === DANGER ZONE === */
.ap-danger-zone {
    background: var(--ap-error-light);
    border: 2px solid var(--ap-error);
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .ap-panel-wrapper {
        grid-template-columns: 1fr;
    }
    
    .ap-panel-sidebar {
        position: relative;
        height: auto;
    }
    
    .ap-panel-content {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 768px) {
    .ap-panel-content {
        padding: 1.5rem 1rem;
    }
    
    .ap-form-row {
        grid-template-columns: 1fr;
    }
    
    .ap-dashboard-cards {
        grid-template-columns: 1fr;
    }
    
    .ap-checkbox-grid {
        grid-template-columns: 1fr;
    }
    
    .ap-plan-cards {
        grid-template-columns: 1fr;
    }
    
    .ap-panel-header h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .ap-panel-wrapper {
        margin: -20px -15px;
    }
    
    .ap-form-panel {
        padding: 1.5rem 1rem;
    }
    
    .ap-btn-large {
        width: 100%;
    }
}

/* === LOADING & ANIMATIONS === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ap-panel-content > * {
    animation: fadeIn 0.3s ease-out;
}

/* === SCROLLBAR === */
.ap-panel-sidebar::-webkit-scrollbar {
    width: 6px;
}

.ap-panel-sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.ap-panel-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.ap-panel-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}
