/* ============================================
   AI RECEPCJA - CUSTOM STYLES
   Kolory: Dark Orchid Theme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

:root {
    /* Kolory główne */
    --color-primary: #9932CC;
    --color-accent: #800080;
    --color-energetic: #BA55D3;
    --color-bg-light: #F8F5FF;

    /* Gradient dla przycisków */
    --gradient-primary: linear-gradient(135deg, #9932CC 0%, #800080 100%);

    /* Cienie */
    --shadow-primary: 0 4px 14px rgba(153, 50, 204, 0.25);
    --shadow-hover: 0 6px 20px rgba(153, 50, 204, 0.35);
    --shadow-focus: 0 0 0 4px rgba(186, 85, 211, 0.3);

    /* Fonty */
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Animacje */
    --transition-smooth: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

body {
    font-family: var(--font-body);
    color: #2d3748;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 600;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-family: var(--font-heading);
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-primary);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

form .btn-primary,
form button[type="submit"] {
    margin-top: 2.5rem;
}

.btn-secondary {
    background: white;
    color: var(--color-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-family: var(--font-heading);
    border: 2px solid var(--color-primary);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-secondary:hover {
    background: var(--color-bg-light);
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.btn-action {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-family: var(--font-heading);
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    background: linear-gradient(135deg, #111827 0%, #000000 100%);
}

/* ============================================
   INPUTS
   ============================================ */

.input-field {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--color-primary);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition-smooth);
    background: white;
}

.input-field:focus {
    outline: none;
    border-color: var(--color-energetic);
    box-shadow: var(--shadow-focus);
}

.input-field::placeholder {
    color: #a0aec0;
}

textarea.input-field {
    resize: vertical;
    min-height: 100px;
}

select.input-field {
    cursor: pointer;
}

/* ============================================
   SWITCH TOGGLE
   ============================================ */

.switch-container {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e0;
    transition: var(--transition-smooth);
    border-radius: 28px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: var(--transition-smooth);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked+.slider {
    background: var(--gradient-primary);
}

input:checked+.slider:before {
    transform: translateX(24px);
}

.slider:hover {
    opacity: 0.9;
}

/* ============================================
   SIDEBAR MENU
   ============================================ */

.sidebar {
    background: linear-gradient(180deg, var(--color-accent) 0%, #600060 100%);
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    transition: var(--transition-smooth);
    font-family: var(--font-body);
    font-weight: 500;
}

.menu-item:hover {
    background: rgba(186, 85, 211, 0.2);
    color: white;
}

.menu-item.active {
    background: var(--color-energetic);
    color: white;
    box-shadow: 0 4px 12px rgba(186, 85, 211, 0.4);
    font-weight: 600;
}

.menu-item i {
    width: 24px;
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

/* ============================================
   CARDS
   ============================================ */

.card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(153, 50, 204, 0.08);
    transition: var(--transition-smooth);
    border: 1px solid rgba(153, 50, 204, 0.1);
    margin-bottom: 3rem;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(153, 50, 204, 0.15);
    transform: translateY(-2px);
}

.card-header {
    background: var(--gradient-primary);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px 12px 0 0;
    font-family: var(--font-heading);
    font-weight: 600;
}

.card-light {
    background: var(--color-bg-light);
    border: 2px solid var(--color-primary);
}

/* Status Cards */
.status-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(153, 50, 204, 0.08);
    transition: var(--transition-smooth);
    border-left: 4px solid transparent;
    position: relative;
}

.status-card.connected {
    border-left-color: #28a745;
    background: linear-gradient(135deg, #f0fdf4 0%, white 100%);
}

.status-card.optional {
    border-left-color: #ffc107;
    background: linear-gradient(135deg, #fffbeb 0%, white 100%);
}

.status-card.missing {
    border-left-color: #dc3545;
    background: linear-gradient(135deg, #fef2f2 0%, white 100%);
}

.status-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(153, 50, 204, 0.15);
}

.status-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.status-card.connected .status-icon {
    background: #d4edda;
    color: #28a745;
}

.status-card.optional .status-icon {
    background: #fff3cd;
    color: #856404;
}

.status-card.missing .status-icon {
    background: #f8d7da;
    color: #dc3545;
}

.status-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.status-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
}

/* Voice Cards */
.voices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.voice-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem;
    transition: var(--transition-smooth);
    cursor: pointer;
    position: relative;
}

.voice-card:hover {
    border-color: #9333ea;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(147, 51, 234, 0.15);
}

.voice-card.selected {
    border-color: #7c3aed;
    border-width: 3px;
    background: linear-gradient(135deg, #faf5ff 0%, white 100%);
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.2);
}

.voice-card.selected::after {
    content: '✓';
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.4);
}

.voice-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.875rem;
}

.voice-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
}

.voice-info h4 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.voice-gender {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 500;
}

.voice-description {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.voice-preview-btn {
    width: 100%;
    padding: 0.625rem;
    background: #f9fafb;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.voice-preview-btn:hover {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    border-color: #9333ea;
    color: #7c3aed;
}

/* ============================================
   BADGES & TAGS
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font-heading);
}

.badge-primary {
    background: var(--color-bg-light);
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}

.badge-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ============================================
   ALERTS
   ============================================ */

.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-family: var(--font-body);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideInRight 0.3s ease-out, fadeOut 0.3s ease-out 4.7s forwards;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

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

.alert-info {
    background: var(--color-bg-light);
    color: var(--color-accent);
    border-left: 4px solid var(--color-primary);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

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

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

/* ============================================
   ICONS
   ============================================ */

.icon-outlined {
    font-weight: 400;
    font-size: 1.25rem;
    color: var(--color-primary);
}

.icon-lg {
    font-size: 2rem;
}

.icon-xl {
    font-size: 3rem;
}

/* ============================================
   TABLES
   ============================================ */

.services-table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(153, 50, 204, 0.1);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(153, 50, 204, 0.08);
}

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

.table th {
    padding: 1.125rem 1.25rem;
    text-align: left;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.95rem;
    vertical-align: middle;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background: linear-gradient(90deg, #f8f5ff 0%, white 100%);
    transform: scale(1.01);
}

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

.table-action-btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: var(--transition-smooth);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.table-action-btn.edit {
    background: #e0f2fe;
    color: #0369a1;
}

.table-action-btn.edit:hover {
    background: #0ea5e9;
    color: white;
}

.table-action-btn.delete {
    background: #fee2e2;
    color: #dc2626;
}

.table-action-btn.delete:hover {
    background: #dc2626;
    color: white;
}

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #f8f5ff 0%, white 100%);
    border-radius: 12px;
    border: 2px dashed var(--color-primary);
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--color-primary);
    opacity: 0.3;
    margin-bottom: 1rem;
}

.empty-state-text {
    color: #6b7280;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

/* ============================================
   HERO SECTIONS
   ============================================ */

.hero {
    background: var(--gradient-primary);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-primary);
}

.hero h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.hero p {
    opacity: 0.9;
    font-size: 1.05rem;
}

.test-cta-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 2.5rem;
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
    margin: 3rem 0 4rem 0;
}

.test-cta-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.3;
    }
}

.test-cta-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.test-cta-text h3 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.test-cta-text p {
    font-size: 1.05rem;
    opacity: 0.95;
    margin-bottom: 1rem;
}

.phone-display {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.875rem 1.5rem;
    border-radius: 50px;
    backdrop-filter: blur(10px);
    font-size: 1.25rem;
    font-weight: 700;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.phone-icon {
    width: 40px;
    height: 40px;
    background: white;
    color: #667eea;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    animation: ring 2s ease-in-out infinite;
}

@keyframes ring {

    0%,
    100% {
        transform: rotate(0deg);
    }

    10%,
    30% {
        transform: rotate(-15deg);
    }

    20%,
    40% {
        transform: rotate(15deg);
    }
}

.test-cta-warning {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #fee2e2;
    color: #991b1b;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 1rem;
}

.test-cta-warning.low-minutes {
    background: #fef3c7;
    color: #92400e;
}

/* ============================================
   PROGRESS BARS
   ============================================ */

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    transition: width 0.5s ease;
    border-radius: 4px;
}

/* ============================================
   FORMS
   ============================================ */

.form-section {
    background: white;
    border-radius: 12px;
    padding: 1.75rem;
    margin-top: 4rem;
    margin-bottom: 3rem;
    box-shadow: 0 2px 8px rgba(153, 50, 204, 0.08);
    border: 1px solid rgba(153, 50, 204, 0.1);
}

.form-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--color-bg-light);
}

.form-section-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.form-section-icon.dark {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}

.form-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    font-family: var(--font-heading);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-hint {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 0.375rem;
    font-style: italic;
}

/* ============================================
   LOADING SPINNER
   ============================================ */

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(153, 50, 204, 0.1);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   TOOLTIPS
   ============================================ */

.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-accent);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: var(--shadow-primary);
}

/* ============================================
   CUSTOM SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
}

/* ============================================
   SPECIAL SECTIONS
   ============================================ */

#services-section {
    margin-top: 5rem !important;
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */

@media (max-width: 768px) {

    .btn-primary,
    .btn-secondary,
    .btn-action {
        width: 100%;
        justify-content: center;
    }

    .card,
    .status-card {
        padding: 1rem;
    }

    .hero h1,
    .test-cta-text h3 {
        font-size: 1.5rem;
    }

    .test-cta-content {
        flex-direction: column;
        text-align: center;
    }

    .test-cta-hero {
        padding: 1.5rem;
    }

    .test-cta-text h3 {
        font-size: 1.35rem;
    }

    .phone-display {
        font-size: 1.1rem;
        padding: 0.75rem 1.25rem;
    }

    .voices-grid {
        grid-template-columns: 1fr;
    }
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-secondary { background: #f3f4f6; color: #4b5563; }

/* ============================================
   TOAST NOTIFICATIONS (Dark Orchid Theme)
   ============================================ */

#toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: none;
    /* Pozwala klikać "pod" kontenerem */
}

.toast-notification {
    pointer-events: auto;
    background: white;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    /* Zgodne z .card */
    box-shadow: 0 8px 24px rgba(153, 50, 204, 0.15);
    /* Cień pasujący do motywu */
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    min-width: 320px;
    max-width: 450px;
    border-left: 5px solid transparent;
    transform: translateX(0);
    opacity: 1;
    transition: var(--transition-smooth);
    overflow: hidden;
}

/* Ikony w dymkach */
.toast-notification i {
    font-size: 1.1rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Wariant: SUKCES */
.toast-success {
    border-left-color: #28a745;
}

.toast-success i {
    background: #d4edda;
    color: #155724;
}

/* Wariant: BŁĄD */
.toast-error {
    border-left-color: #dc3545;
}

.toast-error i {
    background: #f8d7da;
    color: #721c24;
}

/* Stany animacji (obsługiwane przez JS) */
.toast-hidden {
    transform: translateX(120%);
    opacity: 0;
}