* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #9E1B32, #C41E3A);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 2rem;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.nav {
    display: flex;
    gap: 2rem;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
    display: inline-block;
    vertical-align: middle;
    line-height: 1.5;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    height: auto;
    width: auto;
}

/* Specific styling for button elements in nav */
button.nav-link {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    text-align: left;
    vertical-align: baseline;
    line-height: inherit;
    font-size: inherit;
    font-family: inherit;
    font-weight: inherit;
    color: inherit;
    text-decoration: inherit;
    display: inline-block;
    vertical-align: middle;
}

.nav-link:hover,
.nav-link.active {
    opacity: 0.8;
    border-bottom: 2px solid white;
    padding-bottom: 2px;
}


/* Hero Section */
.hero {
    background: white;
    color: #9E1B32;
    padding: 8rem 0 6rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(158, 27, 50, 0.05) 50%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.hero-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    align-items: center;
    margin-bottom: 4rem;
    position: relative;
    z-index: 2;
}

.hero-text {
    text-align: left;
}

.hero h2 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    animation: fadeInUp 1s ease-out;
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2.5rem;
    opacity: 0.8;
    line-height: 1.6;
    color: #666;
    animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    animation: fadeInUp 1s ease-out 0.4s both;
}

.cta-button {
    padding: 1.2rem 2.5rem;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.cta-button.primary {
    background: #9E1B32;
    color: white;
    box-shadow: 0 4px 15px rgba(158, 27, 50, 0.3);
}

.cta-button.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.cta-button.secondary {
    background: transparent;
    color: #9E1B32;
    border: 2px solid #9E1B32;
}

.cta-button.secondary:hover {
    background: #9E1B32;
    color: white;
    transform: translateY(-3px);
}

.hero-stats {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeInUp 1s ease-out 0.6s both;
}

.stat-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    border: 2px solid #9E1B32;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 15px rgba(158, 27, 50, 0.1);
}

.stat-card:hover {
    transform: translateY(-5px);
    background: #9E1B32;
    color: white;
    box-shadow: 0 8px 25px rgba(158, 27, 50, 0.2);
}

.stat-card:hover .stat-number {
    color: white;
}

.stat-card:hover .stat-label {
    color: white;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #9E1B32;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 500;
}

.hero-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
    animation: fadeInUp 1s ease-out 0.8s both;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    border: 2px solid #9E1B32;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(158, 27, 50, 0.1);
}

.feature-card:hover {
    transform: translateY(-10px);
    background: #9E1B32;
    color: white;
    box-shadow: 0 10px 30px rgba(158, 27, 50, 0.2);
}

.feature-card:hover i {
    color: white;
}

.feature-card:hover h3 {
    color: white;
}

.feature-card:hover p {
    color: white;
    opacity: 1;
}

.feature-card i {
    font-size: 3rem;
    color: #9E1B32;
    margin-bottom: 1rem;
    display: block;
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.feature-card p {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
}

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

/* Search Section */
.search-section {
    padding: 4rem 0;
    background: white;
}

.search-section h2 {
    text-align: center;
    margin-bottom: 3rem;
    color: #9E1B32;
    font-size: 2.5rem;
}

.search-filters {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 3rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.search-bar input {
    flex: 1;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
}

.search-bar button {
    background: #9E1B32;
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s;
}

.search-bar button:hover {
    background: #7a1428;
}

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.filters select,
.filters input {
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
}

/* Notes Grid */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.note-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    border-left: 4px solid #9E1B32;
}

.note-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.note-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.note-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.meta-tag {
    background: #9E1B32;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.meta-tag.topic {
    background: #6c757d;
}

.meta-tag.teacher {
    background: #28a745;
}

.note-content {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1rem;
    max-height: 100px;
    overflow: hidden;
    position: relative;
}

.note-footer {
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.rating-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.current-rating, .add-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rating-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #666;
}

.rating-text {
    font-size: 0.9rem;
    color: #9E1B32;
    font-weight: 600;
}

.rating-stars .star {
    cursor: default;
}

.rated-text {
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
}

.note-author {
    font-weight: 500;
    color: #9E1B32;
}

.rating {
    display: flex;
    gap: 2px;
}

.star {
    color: #ddd;
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.2s;
}

.star.active {
    color: #ffc107;
}

.expand-btn {
    background: none;
    border: none;
    color: #9E1B32;
    cursor: pointer;
    font-weight: 500;
    text-decoration: underline;
}

/* Login Section */
.login-section {
    background: #f8f9fa;
    padding: 4rem 0;
}

.login-section h2 {
    text-align: center;
    margin-bottom: 3rem;
    color: #9E1B32;
    font-size: 2.5rem;
}

.auth-container {
    max-width: 800px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.auth-form {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.auth-form h3 {
    text-align: center;
    margin-bottom: 2rem;
    color: #9E1B32;
    font-size: 1.5rem;
}

.auth-form p {
    text-align: center;
    margin-top: 1rem;
    color: #666;
}

.auth-form a {
    color: #9E1B32;
    text-decoration: none;
    font-weight: 500;
}

.auth-form a:hover {
    text-decoration: underline;
}

/* Upload Section */
.upload-section {
    background: #f8f9fa;
    padding: 4rem 0;
}

.upload-section h2 {
    text-align: center;
    margin-bottom: 3rem;
    color: #9E1B32;
    font-size: 2.5rem;
}

.upload-form {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.file-help {
    display: block;
    margin-top: 5px;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #9E1B32;
}

.submit-btn {
    width: 100%;
    background: #9E1B32;
    color: white;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.submit-btn:hover {
    background: #7a1428;
}

/* Error Messages */
.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}

.error-message.show {
    display: block;
}

.form-group input.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Footer */
.footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 2rem 0;
}

/* Section Display */
section {
    display: none;
}

section.active {
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .hero {
        padding: 4rem 0 3rem;
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .hero h2 {
        font-size: 2.5rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .hero-stats {
        flex-direction: row;
        justify-content: space-around;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .hero-features {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .notes-grid {
        grid-template-columns: 1fr;
    }

    .filters {
        grid-template-columns: 1fr;
    }

    .search-bar {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .hero h2 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .cta-button {
        padding: 1rem 2rem;
        font-size: 1rem;
    }

    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .stat-number {
        font-size: 1.8rem;
    }
}

/* Loading Animation */
.loading {
    text-align: center;
    padding: 2rem;
    color: #9E1B32;
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-size: 1.2rem;
}

/* Individual Note Page */
.note-page {
    padding: 2rem 0;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.note-header {
    margin-bottom: 2rem;
    text-align: center;
    max-width: 800px;
    width: 100%;
}

.back-btn {
    background: #9E1B32;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.back-btn:hover {
    background: #7a1428;
}


.note-page h1 {
    color: #9E1B32;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.note-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.note-content-full {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 10px;
    line-height: 1.8;
    font-size: 1.1rem;
    margin-bottom: 2rem;
    white-space: pre-wrap;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}

.note-content-full p {
    margin-bottom: 1.5rem;
    text-indent: 1.5rem;
}

.note-content-full h1,
.note-content-full h2,
.note-content-full h3,
.note-content-full h4,
.note-content-full h5,
.note-content-full h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #9E1B32;
    text-align: left;
}

.note-content-full ul,
.note-content-full ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.note-content-full li {
    margin-bottom: 0.5rem;
}

.file-attachment {
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 5px;
    padding: 8px 12px;
    margin-top: 10px;
    font-size: 0.9rem;
    color: #1976d2;
}

.file-attachment i {
    margin-right: 5px;
}

.file-attachment-full {
    background: #f8f9fa;
    border: 2px solid #9E1B32;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.file-attachment-full h4 {
    color: #9E1B32;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.file-attachment-full h4 i {
    margin-right: 8px;
}

.file-info {
    background: white;
    padding: 1rem;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.note-footer-full {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-top: 2px solid #e0e0e0;
    max-width: 800px;
    width: 100%;
}

.note-date {
    color: #666;
    font-size: 0.9rem;
}
