/* Home-specific styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}


/* Extra small screens (phones in portrait) */
@media (max-width: 480px) {
    .navbar {
        padding: 0.5rem 0.8rem;
        height: 65px;
    }
    
    .nav-left .logo {
        font-size: 0.9rem;
    }
    
    .nav-center {
        margin: 0 0.5rem;
    }
    
    .search-box {
        font-size: 0.85rem;
        padding: 0.35rem 0.7rem;
    }
    
    .nav-right {
        gap: 0.3rem;
    }
    
    .icon-btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.85rem;
    }
    
    .slider-container {
        margin: 0.75rem;
    }
    
    .slide {
        padding: 1.5rem 1rem;
        min-height: 260px;
    }
    
    .slide h1, .slide h2 {
        font-size: 1.2rem;
    }
    
    .slide p {
        font-size: 0.9rem;
    }
    
    .upload-btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .notes-grid {
        padding: 0.75rem;
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .card-cover-image {
        height: 160px;
    }
    
    .pdf-icon {
        width: 45px;
        height: 45px;
        margin: 0.8rem auto;
    }
    
    .voting-container {
        margin: 0.75rem;
        border-radius: 15px;
    }
    
    .voting-card {
        padding: 2rem 1rem;
    }
    
    .vote-title {
        font-size: 1.8rem;
    }
    
    .vote-description {
        font-size: 0.95rem;
    }
    
    .vote-btn, .already-voted-btn {
        padding: 0.8rem 2rem;
        font-size: 0.95rem;
    }
    
    .vote-count {
        font-size: 2rem;
    }
    
    .vote-counter {
        padding: 1rem;
        min-width: 120px;
    }
    
    .pulse-circle {
        width: 70px;
        height: 70px;
    }
    
    .pulse-circle-2 {
        width: 100px;
        height: 100px;
    }
    
    .floating-icons i {
        font-size: 1.2rem;
    }
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: var(--navbar-bg);
    box-shadow: 0 2px 8px var(--shadow);
    height: 80px;
    max-width: 100%;
    overflow-x: hidden;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.3s ease;
}

.logo {
    text-decoration: none;
    color: var(--text-color);
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.nav-center {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    max-width: 400px;
    height: 40px;
    margin: 0 2rem;
}

.search-form {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    align-items: center;
}

.search-box {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    outline: none;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    background-color: var(--card-bg);
    color: var(--text-color);
}

.search-box:focus {
    border-color: #444444;
    box-shadow: 0 0 0 3px rgba(68, 68, 68, 0.2);
}

.dark-mode .search-box:focus {
    border-color: #555555;
    box-shadow: 0 0 0 3px rgba(85, 85, 85, 0.3);
}

.search-box::placeholder {
    color: var(--text-secondary);
}

.search-btn,
.icon-btn {
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.icon-btn:hover {
    background-color: var(--border-color);
    border-radius: 8px;
}

.dark-mode .icon-btn:hover {
    background-color: #1a1a1a;
}

.nav-right {
    display: flex;
    gap: 1rem;
}

/* Voting Interface Styles */
.voting-container {
    position: relative;
    max-width: 100%;
    width: 100%;
    margin: 2rem auto;
    overflow: hidden;
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow);
    transition: all 0.3s ease;
}

.voting-card {
    position: relative;
    padding: 3rem 2rem;
    text-align: center;
    color: white;
    overflow: hidden;
}

.voting-content {
    position: relative;
    z-index: 10;
}

.vote-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: bold;
    color: white !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1s ease-out;
}

.vote-description {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    font-size: 1.1rem;
    line-height: 1.6;
    animation: fadeInUp 1s ease-out 0.2s both;
}

.vote-stats {
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease-out 0.4s both;
}

.vote-counter {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.5rem;
    display: inline-block;
    min-width: 150px;
    transition: all 0.3s ease;
}

.vote-counter:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.25);
}

.vote-count {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: countUp 2s ease-out;
}

.vote-label {
    display: block;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    opacity: 0.8;
}

.vote-actions {
    animation: fadeInUp 1s ease-out 0.6s both;
}

.vote-btn, .already-voted-btn {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #333;
    border: none;
    padding: 1rem 3rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.vote-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s;
}

.vote-btn:hover::before {
    left: 100%;
}

.vote-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.6);
}

.vote-btn:active {
    transform: translateY(-1px);
    animation: pulse 0.3s ease-in-out;
}

.already-voted-btn {
    background: linear-gradient(45deg, #28a745, #20c997);
    cursor: not-allowed;
    opacity: 0.8;
}

.voting-animation {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}

.pulse-circle, .pulse-circle-2 {
    position: absolute;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    animation: pulse-expand 3s ease-in-out infinite;
}

.pulse-circle {
    width: 100px;
    height: 100px;
    top: 20%;
    right: 10%;
    animation-delay: 0s;
}

.pulse-circle-2 {
    width: 150px;
    height: 150px;
    bottom: 20%;
    left: 5%;
    animation-delay: 1.5s;
}

.floating-icons {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.floating-icons i {
    position: absolute;
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.3);
    animation: float 4s ease-in-out infinite;
}

.floating-icons i:nth-child(1) {
    top: -50px;
    left: -40px;
    animation-delay: 0s;
}

.floating-icons i:nth-child(2) {
    top: -20px;
    right: -50px;
    animation-delay: 1.3s;
}

.floating-icons i:nth-child(3) {
    bottom: -40px;
    left: -30px;
    animation-delay: 2.6s;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-expand {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.2;
    }
    100% {
        transform: scale(1);
        opacity: 0.5;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-10px) rotate(5deg);
    }
    50% {
        transform: translateY(-5px) rotate(-5deg);
    }
    75% {
        transform: translateY(-15px) rotate(3deg);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes countUp {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Success animation */
.voting-card.vote-success {
    animation: voteSuccess 1s ease-out;
}

@keyframes voteSuccess {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 40px rgba(74, 144, 226, 0.5);
    }
    100% {
        transform: scale(1);
    }
}

/* Notification styles */
.notification {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Notes Grid Styles */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    /* grid-template-columns: repeat(4,1fr); */
    gap: 1rem;
    padding: 2rem;
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
}

.note-card {
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px var(--shadow);
    transition: all 0.3s ease;
    position: relative;
}

.note-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px var(--shadow-hover);
}

.note-card:hover .card-cover-image {
    transform: scale(1.02);
}

.note-card:hover .note-info {
    background: var(--card-bg);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Cover image styles */
.card-cover-image {
    width: 100%;
    height: 280px;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: flex-end;
    background-color: var(--border-color);
    transition: all 0.3s ease;
    border-radius: 8px 8px 0 0;
    /* Ensure the image doesn't overflow the rounded corners */
    overflow: hidden;
}

.card-cover-image:not(.loaded) {
    opacity: 0.7;
    background: linear-gradient(45deg, var(--border-color) 25%, transparent 25%), 
                linear-gradient(-45deg, var(--border-color) 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, var(--border-color) 75%), 
                linear-gradient(-45deg, transparent 75%, var(--border-color) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.card-cover-image.loaded {
    opacity: 1;
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(transparent 0%, transparent 60%, rgba(0, 0, 0, 0.4) 85%, rgba(0, 0, 0, 0.7) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Add a subtle gradient at the bottom of the cover image for smooth transition */
.card-cover-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(transparent, var(--card-bg));
    pointer-events: none;
    z-index: 1;
}

.unit-code-overlay {
    color: white;
    font-weight: bold;
    font-size: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 1px;
    text-align: center;
}

/* PDF icon for units without cover images */
.pdf-icon {
    background-color: #fd4d4d;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1.5rem auto;
    font-weight: bold;
}

.note-info {
    padding: 1.5rem;
    text-align: center;
    position: relative;
    background: var(--card-bg);
    border-radius: 0 0 8px 8px;
    /* Add a subtle inner shadow to create depth */
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    /* Create a smooth transition effect */
    transform: translateZ(0);
    backface-visibility: hidden;
}

.course-code {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.note-info h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    min-height: 2.6em;
    color: var(--text-color);
}

.pages {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.price {
    font-weight: bold;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.view-pdf-btn {
    background-color: var(--button-bg);
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.view-pdf-btn:hover {
    background-color: var(--button-hover);
    transform: translateY(-2px);
}

.dark-mode .view-pdf-btn {
    background-color: #1a1a1a;
    border: 1px solid #333333;
}

.dark-mode .view-pdf-btn:hover {
    background-color: #222222;
    border-color: #444444;
}

.course-code {
    margin-bottom: 0.5rem;
}

.pages {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}
.loader {
    position: relative;
    width: 100px;
    height: 16px;
    margin: 0 auto;
    align-items: center;
    justify-content: center;
  }
.loader:before , .loader:after{
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #e70000;
    box-shadow: 32px 0 #220000;
    left: 0;
    top: 0;
    animation: ballMoveX 1s linear infinite;
  }
.loader:after {
    box-shadow: none;
    transform-origin: 40px 0;
    transform: rotate(-153deg);
    animation: rotateLoader 1s linear infinite;
  }

@keyframes rotateLoader {
    0% , 10%{ transform: rotate(-153deg); }
    90%, 100% { transform: rotate(0deg); }
  }
@keyframes ballMoveX {
    0% , 10%{  transform: translateX(0) }
    90%, 100% { transform: translateX(32px) }
  }
      
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    * {
        max-width: 100%;
    }
    
    /* Better navbar for mobile */
    .navbar {
        padding: 0.75rem 1rem;
        height: 70px;
        flex-wrap: nowrap;
    }
    
    .nav-left .logo {
        font-size: 1rem;
        font-weight: 700;
    }
    
    .nav-center {
        margin: 0 0.75rem;
        max-width: none;
        flex: 1;
        min-width: 0;
    }
    
    .search-box {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
        border-radius: 15px;
        min-width: 0;
    }
    
    .search-btn {
        padding: 0.4rem 0.8rem;
    }
    
    .nav-right {
        gap: 0.5rem;
        flex-shrink: 0;
    }
    
    .icon-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.9rem;
    }
    
    /* Better slider for mobile */
    .slider-container {
        margin: 1rem;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    
    .slide {
        padding: 2rem 1.5rem;
        min-height: 280px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }
    
    .slide h1, .slide h2 {
        font-size: 1.4rem;
        line-height: 1.3;
        margin-bottom: 1rem;
        color: var(--text-color);
    }
    
    .slide p {
        font-size: 0.95rem;
        line-height: 1.5;
        color: var(--text-secondary);
        margin-bottom: 1.5rem;
        max-width: 90%;
        margin-left: auto;
        margin-right: auto;
    }
    
    .upload-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.95rem;
        border-radius: 25px;
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        justify-content: center;
        transition: all 0.3s ease;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        background-color: var(--button-bg);
    }
    
    .upload-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        background-color: var(--button-hover);
    }
    
    .dark-mode .upload-btn {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    }
    
    .dark-mode .upload-btn:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
    }
    
    /* Better navigation arrows */
    .prev-btn, .next-btn {
        padding: 0.8rem;
        font-size: 1rem;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        transition: all 0.3s ease;
    }
    
    .prev-btn {
        left: 10px;
    }
    
    .next-btn {
        right: 10px;
    }
    
    /* Better dots */
    .dots-container {
        bottom: 1.5rem;
        gap: 0.8rem;
    }
    
    .dot {
        width: 12px;
        height: 12px;
        transition: all 0.3s ease;
    }
    
    .dot.active {
        transform: scale(1.2);
    }
    
    /* Better notes grid */
    .notes-grid {
        padding: 1rem;
        gap: 1rem;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    
    .note-card {
        border-radius: 12px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
        transition: all 0.3s ease;
        overflow: hidden;
    }
    
    .note-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    }
    
    .card-cover-image {
        border-radius: 12px 12px 0 0;
    }
    
    .pdf-icon {
        width: 50px;
        height: 50px;
        margin: 1rem auto;
        font-size: 1.2rem;
    }
    
    .note-info {
        padding: 1rem;
    }
    
    .note-info h3 {
        font-size: 1rem;
        line-height: 1.4;
        min-height: 2.8em;
    }
    
    .view-pdf-btn {
        padding: 0.7rem 1rem;
        border-radius: 8px;
        font-size: 0.9rem;
        font-weight: 600;
        transition: all 0.3s ease;
    }
}

/* Extra small screens (phones in portrait) */
@media (max-width: 480px) {
    .navbar {
        padding: 0.5rem 0.8rem;
        height: 65px;
    }
    
    .nav-left .logo {
        font-size: 0.9rem;
    }
    
    .nav-center {
        margin: 0 0.5rem;
    }
    
    .search-box {
        font-size: 0.85rem;
        padding: 0.35rem 0.7rem;
    }
    
    .nav-right {
        gap: 0.3rem;
    }
    
    .icon-btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.85rem;
    }
    
    .slider-container {
        margin: 0.75rem;
    }
    
    .slide {
        padding: 1.5rem 1rem;
        min-height: 260px;
    }
    
    .slide h1, .slide h2 {
        font-size: 1.2rem;
    }
    
    .slide p {
        font-size: 0.9rem;
    }
    
    .upload-btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .notes-grid {
        padding: 0.75rem;
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

/* Mobile search improvements */
@media (max-width: 768px) {
    .search-form {
        gap: 0.3rem;
    }
    
    .search-box {
        -webkit-appearance: none;
        appearance: none;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Hide search button on mobile */
@media (max-width: 768px) {
    .search-btn {
        display: none;
    }
}