:root {
    --sidebar-width: 280px;
    --primary-purple: #9333ea;
    --secondary-purple: #a855f7;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    padding: 1.5rem;
    transition: all 0.3s ease;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(180deg, #1a1a1a 0%, #0a0a0a 100%);
}

.sidebar h3 {
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(90deg, var(--primary-purple), var(--secondary-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar .nav-link {
    padding: 0.5rem 0;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.sidebar .nav-link:hover {
    opacity: 1;
    transform: translateX(5px);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 2rem;
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
}

/* Cards */
.subject-card {
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    aspect-ratio: 9/16;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    max-width: 200px;
    margin: 0 auto;
}

.subject-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.8) 100%);
    z-index: 1;
}

.subject-card .card-body {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
}

.subject-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.subject-card .card-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: white !important;
}

.subject-card .card-text {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 1.1rem;
}

/* Flashcards */
.flashcard {
    perspective: 1000px;
    width: 250px;
    height: 250px;
    cursor: pointer;
    margin-bottom: 2rem;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    cursor: pointer;
}

.flashcard.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7));
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 15px;
}

.flashcard-front {
    color: #fff;
}

.flashcard-front p {
    font-size: 1.2rem;
    margin: 0;
    text-align: center;
}

.flashcard-back {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7));
    color: #fff;
    transform: rotateY(180deg);
    text-align: left;
}

.flashcard-back ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1.2rem;
    text-align: left;
}

.flashcard-back strong {
    color: var(--primary-purple);
    display: block;
    margin-bottom: 0.5rem;
}

/* Back Button */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-purple);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.back-button:hover {
    color: var(--secondary-purple);
    transform: translateX(-5px);
}

.back-button i {
    font-size: 1.2rem;
}

/* Social Links */
.social-link {
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    padding: 0.75rem;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    width: 3rem;
    height: 3rem;
}

.social-link:hover {
    color: var(--primary-purple);
    background: rgba(147, 51, 234, 0.1);
    transform: translateY(-3px);
}

.social-link i {
    font-size: 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1000;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .toggle-sidebar {
        z-index: 1001;
    }
}
