:root {
    --primary-color: #8b5cf6; /* Purple */
    --primary-dark: #7c3aed;
    --secondary-color: #6b7280; /* Gray */
    --gradient-start: #8b5cf6;
    --gradient-end: #6b7280;
    --gradient-mid: #7c3aed; /* Added for audio player */
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f9fafb;
    padding: 20px;
    margin: 0;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    padding: 0 15px;
    box-sizing: border-box;
}

/* Custom gradient background */
.brand-gradient {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
}

.brand-gradient-text {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Custom styles for the circular progress bar */
.progress-ring__circle {
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    transition: stroke-dashoffset 0.5s ease;
}

.chat-container {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

/* Custom scrollbar for chat */
.chat-container::-webkit-scrollbar {
    width: 6px;
}

.chat-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.chat-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Animation for typing indicator */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.typing-dot {
    animation: blink 1.5s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

/* Payment modal */
.modal {
    display: none;
    position: fixed;
    z-index: 50;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border-radius: 10px;
    width: 80%;
    max-width: 500px;
    box-sizing: border-box;
}

/* Premium content overlay */
.premium-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    z-index: 10;
    border-radius: 8px;
}

/* Certificate styles */
.certificate {
    border: 10px solid var(--primary-dark);
    padding: 20px;
    text-align: center;
    background-color: #fff;
    position: relative;
    box-sizing: border-box;
}

.certificate:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0icmdiYSgxMzksMTM5LDEzOSwwLjEpIiBkPSJNNTAgMEw4NyA1MEw1MCAxMDBMMTMgNTBaIi8+PC9zdmc+');
    opacity: 0.1;
    z-index: -1;
}

/* Audio Player Styles */
.audio-player {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    box-sizing: border-box;
}

.player-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.player-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.player-title {
    flex: 1;
    min-width: 200px;
}

.player-title h3 {
    margin: 0;
    font-weight: 600;
    font-size: clamp(1rem, 2vw, 1.25rem);
}

.player-title p {
    margin: 0;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.progress-container {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin: 15px 0;
    cursor: pointer;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    border-radius: 4px;
    width: 0%;
}

.player-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.time {
    font-size: 0.9rem;
    color: var(--secondary-color);
    white-space: nowrap;
}

.control-buttons {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.control-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--primary-dark);
    margin: 0 5px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.control-btn:hover {
    background: #f3f4f6;
}

.play-btn {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
}

.play-btn:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, var(--gradient-mid), var(--gradient-start));
}

.volume-container {
    display: flex;
    align-items: center;
    margin-left: 15px;
    flex-shrink: 0;
}

.volume-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-right: 10px;
}

.volume-slider {
    width: 80px;
    -webkit-appearance: none;
    height: 5px;
    border-radius: 5px;
    background: #e5e7eb;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--primary-dark);
    cursor: pointer;
}

/* Content Area Styles */
.content-area {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    box-sizing: border-box;
}

.content-area h3 {
    color: var(--primary-dark);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f3f4f6;
    font-size: clamp(1.1rem, 3vw, 1.5rem);
}

.content-text {
    line-height: 1.6;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.content-text p {
    margin-bottom: 15px;
}

.content-text ul, .content-text ol {
    margin-bottom: 15px;
    padding-left: 20px;
}

.content-text li {
    margin-bottom: 8px;
}

/* Download Button */
.download-btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    margin-top: 15px;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.4);
}

.download-btn i {
    margin-right: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 0 10px;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 90%;
        padding: 15px;
    }
    
    .audio-player {
        padding: 15px;
    }
    
    .player-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .player-icon {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .player-title {
        min-width: auto;
        width: 100%;
    }
    
    .player-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .control-buttons {
        justify-content: center;
        width: 100%;
    }
    
    .volume-container {
        margin-left: 0;
        justify-content: center;
        width: 100%;
    }
    
    .content-area {
        padding: 20px 15px;
    }
    
    .certificate {
        padding: 15px;
        border-width: 5px;
    }
    
    .chat-container {
        max-height: calc(100vh - 150px);
    }
}

@media (max-width: 480px) {
    body {
        padding: 5px;
    }
    
    .container {
        padding: 0 5px;
    }
    
    .audio-player {
        padding: 10px;
    }
    
    .player-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .control-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
        margin: 0 3px;
    }
    
    .play-btn {
        width: 45px;
        height: 45px;
    }
    
    .volume-slider {
        width: 60px;
    }
    
    .content-area {
        padding: 15px 10px;
    }
    
    .download-btn {
        padding: 10px 15px;
        width: 100%;
        justify-content: center;
    }
    
    .modal-content {
        margin: 5% auto;
        width: 95%;
    }
}

/* Tablet specific adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 90%;
    }
    
    .player-title {
        min-width: 250px;
    }
}

/* Large screen adjustments */
@media (min-width: 1200px) {
    .container {
        max-width: 1100px;
    }
}

/* Prevent horizontal scrolling */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* Improve touch targets for mobile */
@media (max-width: 768px) {
    .control-btn, .play-btn, .download-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .progress-container {
        height: 12px;
    }
}