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

:root {
    /* Colors */
    --primary-lighter: #2d2661;
    /* Lighter shade for hover */
    --primary: #140d2e;
    /* Base primary color */
    --primary-darker: #0a0617;
    /* Darker shade for active state */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --filter-active: #34d399;
    --filter-inactive: #9ca3af;

    /* Typography */
    --font-size-sm: 0.75rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;

    /* Spacing */
    --spacing-1: 0.25rem;
    --spacing-2: 0.5rem;
    --spacing-3: 0.5rem;
    --spacing-4: 0.75rem;
    --spacing-6: 1rem;
    --spacing-8: 2rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;

    /* Transitions */
    --transition-base: all 0.2s ease;
}

/* Base Styles */
* {
    box-sizing: border-box;
}

html,
body,
#app {
    height: 100%;
    width: 100%;
    font-family: "Montserrat";
    color: var(--gray-800);
    margin: 0;
    padding: 0;
}

/* Form Styles */
.form-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-8);
}

.form-group {
    margin-bottom: var(--spacing-6);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-2);
    font-weight: 500;
    color: var(--gray-500);
    font-size: var(--font-size-sm);
}

.form-input {
    width: 100%;
    padding: var(--spacing-3);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    transition: var(--transition-base);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(20, 13, 46, 0.1);
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-3) var(--spacing-6);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transform: translateY(0);
    transition: transform 0.2s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Primary button with enhanced hover */
.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    box-shadow: 0 2px 4px rgba(20, 13, 46, 0.1);
}

.btn-primary:hover {
    background-color: var(--primary-lighter);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(45, 38, 97, 0.2);
}

.btn-primary:active {
    background-color: var(--primary-darker);
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(20, 13, 46, 0.1);
}

/* Filter button styles */
.btn-filter {
    background-color: var(--gray-50);
    color: var(--filter-inactive);
    border: 2px solid var(--filter-inactive);
    padding: var(--spacing-2) var(--spacing-4);
    transition: all 0.3s ease;
}

.btn-filter[data-active="true"] {
    background-color: var(--filter-active);
    color: white;
    border-color: var(--filter-active);
}

.btn-filter:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 211, 153, 0.2);
}

.btn-filter svg {
    margin-right: var(--spacing-2);
    transition: transform 0.3s ease;
}

.btn-filter[data-active="true"] svg {
    transform: rotate(360deg);
}

/* Secondary button styles remain the same */
.btn-secondary {
    background-color: white;
    color: var(--gray-500);
    border: 1px solid var(--gray-200);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background-color: var(--gray-50);
    color: var(--gray-700);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-color: var(--gray-300);
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Ripple effect */
.btn::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.1) 10%, transparent 70%);
    transform: scale(10);
    opacity: 0;
    transition: transform 0.5s, opacity 0.5s;
}

.btn:active::after {
    transform: scale(0);
    opacity: 1;
    transition: 0s;
}

/* Layout Utilities */
.button-group {
    display: flex;
    gap: var(--spacing-4);
    margin-top: var(--spacing-8);
}

.header .button-group {
    margin-top: 0;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}    

.loading {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

.alert-error {
    background-color: #fee2e2;
    color: #ef4444;
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d1fae5;
    color: #10b981;
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

/* Card Styles */
.card {
    background-color: white;
    border-radius: var(--radius-lg);
    padding: var(--spacing-8);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Listen History Container tooltip styles */
.listen-history-container {
    padding: 8px;
    position: relative;
}
.listen-count {
    position: relative;
}
.count-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.count-wrapper:hover {
    transform: translateY(-1px);
}
.count-badge {
    background: #4f46e5;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.1);
}
.count-label {
    color: #6b7280;
    font-size: 0.875rem;
}
.history-tags {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 50;
    min-width: 320px;
    max-width: 400px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(229, 231, 235, 0.8);
}
.tooltip-header {
    padding: 12px 16px;
    font-weight: 600;
    color: #111827;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 12px 12px 0 0;
}
.listen-count:hover .history-tags {
    display: block;
    animation: fadeIn 0.2s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.history-tag {
    padding: 8px 16px;
}
.history-tag:last-child {
    border-radius: 0 0 12px 12px;
}
.tag-content {
    background: #f3f4f6;
    padding: 10px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.tag-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.history-id {
    color: #4b5563;
    font-weight: 600;
    font-size: 0.875rem;
}
.history-date {
    color: #6b7280;
    font-size: 0.75rem;
}
.progress-indicator {
    height: 16px;
    background: #e5e7eb;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: #10b981;
    transition: width 0.3s ease;
}
.progress-text {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: white;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.low .progress-bar { background: #ef4444; }
.medium .progress-bar { background: #f59e0b; }
.high .progress-bar { background: #10b981; }

.no-data {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    background-color: #f9fafb;
    border-radius: 0.5rem;
    border: 1px dashed #d1d5db;
}

.no-data svg {
    color: #9ca3af;
    margin-bottom: 1rem;
}

.no-data h2 {
    color: #374151;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.no-data p {
    color: #6b7280;
    font-size: 0.875rem;
}

.info-tooltip-wrapper {
    display: inline-flex;
    position: relative;
    margin-left: 8px;
}

.info-button {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    display: flex;
}

.tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 50;
    transition: opacity 0.2s ease-in-out;
}

.info-tooltip-wrapper:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

.tooltip-content {
    background: white;
    border-radius: 8px;
    padding: 16px;
    width: 400px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #E5E7EB;
}

.tooltip-section {
    margin-bottom: 12px;
}

.tooltip-section:last-child {
    margin-bottom: 0;
}

.tooltip-label {
    font-weight: 600;
    margin-bottom: 6px;
    color: #374151;
    font-size: 0.875rem;
}

.tooltip-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    background-color: #F3F4F6;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 0.8125rem;
    color: #4B5563;
    font-weight: 500;
}

.no-data.tag {
    color: #9CA3AF;
    font-size: 0.8125rem;
    font-style: italic;
    background-color: #F9FAFB;
}

.podcast-stats__table {
    width: 160px;
    border-collapse: collapse;
    font-size: 0.7rem;
    color: #4F46E5;
}

.podcast-stats__table td {
    padding: 0.25rem 0.25rem;
    border: none;
    font-size: 0.7rem;
}

.podcast-stats__table tr:hover td {
    background: transparent;
}

.podcast-stats__table tr {
    border-bottom: 1px solid #E5E7EB;
}

.podcast-stats__table tr:last-child {
    border-bottom: none;
}


.podcast-stats__value {    
    font-weight: 500;
    margin-bottom: 0.25rem;
}
.podcast-stats__label {
    font-weight: 400;    
    white-space: nowrap;
}

.podcast-stats__value--sub {
    font-weight: 400;    
    white-space: nowrap;
    font-size: 0.5rem;
    color: #6b7280;
}


/* Responsive Adjustments */
@media (max-width: 768px) {
    .form-container {
        padding: var(--spacing-4);
    }

    .card {
        padding: var(--spacing-6);
    }
}