/* style.css - Shared across all pages */
:root {
    --primary: #8a2be2;
    --primary-dark: #6a1cb0;
    --secondary: #1db954;
    --dark: #121212;
    --dark-light: #1e1e1e;
    --gray: #b3b3b3;
    --light: #ffffff;
    --danger: #ff4757;
    --success: #2ed573;
    --warning: #ffa502;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: var(--dark);
    color: var(--light);
    min-height: 100vh;
    line-height: 1.6;
}

/* Navigation */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    text-decoration: none;
}

.logo:hover {
    color: var(--primary-dark);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--gray);
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--light);
}

.nav-links a.active {
    color: var(--primary);
}

.auth-buttons {
    display: flex;
    gap: 1rem;
}

/* Buttons */
.btn {
    padding: 0.6rem 1.5rem;
    border-radius: 25px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(138, 43, 226, 0.3);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: #1aa34a;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--gray);
    color: var(--gray);
}

.btn-outline:hover {
    border-color: var(--light);
    color: var(--light);
}

.btn-small {
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 5%;
}

/* Cards */
.card {
    background: var(--dark-light);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-5px);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--gray);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--light);
    font-size: 1rem;
    transition: border 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

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

/* Track Card */
.track-card {
    background: var(--dark-light);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s;
}

.track-card:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.track-cover {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.track-info {
    padding: 1rem;
}

.track-title {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.track-artist {
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.track-stats {
    display: flex;
    justify-content: space-between;
    color: var(--gray);
    font-size: 0.8rem;
    margin-top: 1rem;
}

/* Player */
.player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

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

.player-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.control-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.progress-bar {
    flex: 2;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    cursor: pointer;
    margin: 0 1rem;
}

.progress {
    height: 100%;
    background: var(--primary);
    width: 0%;
    border-radius: 2px;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    z-index: 2000;
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification.success {
    background: var(--success);
}

.notification.error {
    background: var(--danger);
}

.notification.info {
    background: var(--primary);
}

.notification.warning {
    background: var(--warning);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--gray);
}

.loading-spinner {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top: 3px solid var(--primary);
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--gray);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 3rem;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    .player {
        flex-wrap: wrap;
        padding: 0.5rem;
    }
    
    .player-info {
        min-width: auto;
        order: 1;
        width: 100%;
        text-align: center;
    }
    
    .player-controls {
        order: 2;
    }
    
    .progress-bar {
        order: 3;
        width: 100%;
        margin: 0.5rem 0;
    }
}

/* Chat Styles */
.chat-item {
    padding: 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s;
    margin-bottom: 0.5rem;
}

.chat-item:hover {
    background: rgba(255,255,255,0.05);
}

.chat-item.active {
    background: rgba(138, 43, 226, 0.1);
    border-left: 3px solid var(--primary);
}

.message {
    display: flex;
    gap: 1rem;
    max-width: 80%;
    animation: fadeIn 0.3s ease;
}

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

.message.received {
    align-self: flex-start;
}

.message.sent {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-content {
    display: flex;
    flex-direction: column;
}

.message.received .message-content {
    align-items: flex-start;
}

.message.sent .message-content {
    align-items: flex-end;
}

.message-text {
    background: rgba(255,255,255,0.1);
    padding: 0.8rem 1rem;
    border-radius: 15px;
    line-height: 1.4;
    word-wrap: break-word;
    max-width: 100%;
}

.message.received .message-text {
    border-bottom-left-radius: 5px;
    background: rgba(138, 43, 226, 0.2);
}

.message.sent .message-text {
    border-bottom-right-radius: 5px;
    background: rgba(29, 185, 84, 0.2);
}

.message-time {
    font-size: 0.8rem;
    color: var(--gray);
    margin-top: 0.3rem;
    padding: 0 0.5rem;
}

.file-attachment {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255,255,255,0.05);
    padding: 0.8rem;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    flex-wrap: wrap;
}

.file-attachment i {
    font-size: 1.5rem;
    color: var(--primary);
}

.typing-dots {
    display: flex;
    gap: 4px;
    padding: 1rem;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--gray);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--gray);
}

.empty-state i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* Ringtone Animation */
@keyframes ring {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(5deg); }
    50% { transform: rotate(0deg); }
    75% { transform: rotate(-5deg); }
    100% { transform: rotate(0deg); }
}

.ringing-animation {
    animation: ring 0.5s infinite;
    display: inline-block;
}

/* Incoming call styling */
.incoming-call-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #8a2be2, #4a00e0);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease;
}

.incoming-call-icon {
    font-size: 1.5rem;
    animation: ring 0.5s infinite;
}

.incoming-call-info h4 {
    margin: 0;
    font-size: 1rem;
}

.incoming-call-info p {
    margin: 0.2rem 0 0 0;
    font-size: 0.9rem;
    opacity: 0.8;
}