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

html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo h2 {
    color: #667eea;
    font-weight: 700;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.nav-logo h2:hover {
    color: rgba(102, 126, 234, 0.8);
    transform: scale(1.05);
}

.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: #666;
    font-weight: 500;
    padding: 10px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.nav-link.active {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: #667eea;
    border-radius: 2px;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    transition: 0.3s;
}

.nav-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.bar {
    width: 25px;
    height: 3px;
    background: #667eea;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

/* Main Content */
.main-content {
    margin-top: 70px;
    min-height: calc(100vh - 70px);
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

/* Hero Section */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    padding: 60px 0;
    min-height: 70vh;
}

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

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 40px;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.hero-visual {
    position: relative;
    height: 400px;
}

.floating-elements {
    position: relative;
    width: 100%;
    height: 100%;
}

.floating-element {
    position: absolute;
    font-size: 4rem;
    animation: float 6s ease-in-out infinite;
    opacity: 0.8;
}

.floating-element:nth-child(1) {
    top: 20%;
    left: 20%;
    animation-delay: 0s;
}

.floating-element:nth-child(2) {
    top: 60%;
    right: 30%;
    animation-delay: 2s;
}

.floating-element:nth-child(3) {
    bottom: 20%;
    left: 40%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 80px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 40px 30px;
    border-radius: 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease;
}

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

.feature-card i {
    font-size: 3rem;
    color: white;
    margin-bottom: 20px;
}

.feature-card h3 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.feature-card p {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 2.5rem;
    color: white;
    margin-bottom: 15px;
    font-weight: 700;
}

.section-header p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Search and Filters */
.search-filters {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.search-box input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    background: white;
}

.filters {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.filters select {
    padding: 12px 15px;
    border: none;
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    min-width: 150px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #ff5252 0%, #d32f2f 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 107, 107, 0.3);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
}

/* Grids */
.poems-grid, .authors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
    width: 100%;
    max-width: 100%;
    padding: 0 10px;
}

.poem-card, .author-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.poem-card:hover, .author-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.poem-card h3, .author-card h3 {
    color: white;
    font-size: 1.3rem;
    margin-bottom: 10px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-wrap: break-word;
}

.poem-card p, .author-card p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-wrap: break-word;
}

.poem-preview {
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
    margin-top: 15px;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    word-wrap: break-word;
    max-height: 4.5em; /* 3 lines * 1.5 line-height */
}

/* Add Poem Form */
.add-poem-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto;
}

.add-poem-form {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.add-poem-form h3 {
    color: white;
    margin-bottom: 30px;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    color: white;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: none;
    border-radius: 8px;
    background: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-group small {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-top: 5px;
    display: block;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.add-poem-info {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    height: fit-content;
}

.add-poem-info h3 {
    color: white;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.add-poem-info ul {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 25px;
    padding-left: 20px;
}

.add-poem-info li {
    margin-bottom: 10px;
    line-height: 1.5;
}

.info-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.info-card h4 {
    color: white;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.info-card p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

/* Library */
.library-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-card i {
    font-size: 2rem;
    color: white;
}

.stat-info h3 {
    color: white;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-info p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.library-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn.active, .filter-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Admin Panel */
.admin-login {
    max-width: 400px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-form h3 {
    color: white;
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.5rem;
}

.login-hint {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-hint p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.login-hint code {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

.admin-dashboard {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.admin-nav {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    overflow-x: auto;
}

.admin-nav-btn {
    padding: 15px 20px;
    border: none;
    background: none;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-weight: 500;
}

.admin-nav-btn.active, .admin-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.admin-panel {
    display: none;
    padding: 30px;
}

.admin-panel.active {
    display: block;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.panel-header h3 {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
}

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

.admin-table-container {
    overflow-x: auto;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 20px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    color: white;
}

.admin-table th,
.admin-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-table th {
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
}

.admin-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-right: 5px;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.btn-edit {
    background: #667eea;
    color: white;
}

.btn-delete {
    background: #e74c3c;
    color: white;
}

.submissions-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.submission-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.submission-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.submission-user {
    color: white;
    font-weight: 600;
}

.submission-date {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.submission-content {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin-bottom: 15px;
}

.submission-actions {
    display: flex;
    gap: 10px;
}

.broadcast-form {
    max-width: 600px;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-content form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-content .form-group {
    margin-bottom: 15px;
}

.modal-content .form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: 500;
}

.modal-content .form-group input,
.modal-content .form-group select,
.modal-content .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    background: white;
    color: #333;
}

.modal-content .form-group input:focus,
.modal-content .form-group select:focus,
.modal-content .form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal-content .form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.modal-content button[type="submit"] {
    margin-top: 10px;
}

@keyframes modalSlideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

.poem-content h3 {
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.poem-content p {
    color: #666;
    margin-bottom: 20px;
    font-style: italic;
}

.poem-text {
    color: #333;
    line-height: 1.8;
    white-space: pre-wrap;
    margin-bottom: 20px;
}

.poem-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.poem-actions .btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.poem-actions .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.poem-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.poem-actions .btn-secondary {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.poem-actions .btn-secondary:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

/* Loader */
.loader {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.loader-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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



/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: rgba(255, 255, 255, 0.95);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        backdrop-filter: blur(10px);
        padding: 20px 0;
        z-index: 1000;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-toggle {
        display: flex;
        z-index: 1001;
    }
    
    .nav-link {
        padding: 15px 20px;
        font-size: 1.1rem;
        border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }

    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }

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

    .hero-buttons {
        justify-content: center;
    }

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

    .poems-grid, .authors-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0 15px;
        margin: 20px 0;
    }

    .filters {
        flex-direction: column;
    }

    .admin-nav {
        flex-direction: column;
    }

    .admin-nav-btn {
        text-align: left;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .poem-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .add-poem-container {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 15px;
    }
    
    .add-poem-form {
        padding: 25px;
    }
    
    .add-poem-info {
        padding: 25px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 15px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    .search-filters {
        padding: 20px;
    }

    .admin-table-container {
        padding: 10px;
    }

    .admin-table th,
    .admin-table td {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
    
    .poems-grid, .authors-grid {
        gap: 10px;
        padding: 0 10px;
    }
    
    .poem-card, .author-card {
        padding: 20px;
    }
    
    .quotes-container {
        padding: 0 10px;
    }
    
    .quotes-content {
        padding: 10px;
    }
    
    .quote-group {
        padding: 15px;
    }
    
    .quote-group-content .quote-item {
        padding: 12px;
    }
    
    /* Add Poem Form Mobile Styles */
    .add-poem-container {
        padding: 0 10px;
        gap: 15px;
    }
    
    .add-poem-form {
        padding: 20px;
    }
    
    .add-poem-info {
        padding: 20px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-actions .btn {
        width: 100%;
        padding: 12px;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-white { color: white; }
.mb-20 { margin-bottom: 20px; }
.mt-20 { margin-top: 20px; }
.hidden { display: none; }
.visible { display: block; }

/* Quote Highlighting */
.quote {
    background: linear-gradient(120deg, #a8edea 0%, #fed6e3 100%);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus Styles */
button:focus, input:focus, select:focus, textarea:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Success/Error Messages */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    font-weight: 500;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.message.success {
    background: #27ae60;
    color: white;
    border: none;
}

.message.error {
    background: #e74c3c;
    color: white;
    border: none;
}

.message.info {
    background: #3498db;
    color: white;
    border: none;
}

/* Additional modal styles for better visibility */
#addAuthorModal,
#addPoemModal {
    display: none;
}

#addAuthorModal .modal-content,
#addPoemModal .modal-content {
    background: white;
    color: #333;
}

#addAuthorModal h3,
#addPoemModal h3 {
    color: #333;
    margin-bottom: 20px;
}

#addAuthorModal label,
#addPoemModal label {
    color: #333;
    font-weight: 500;
    margin-bottom: 5px;
    display: block;
}

#addAuthorModal input,
#addAuthorModal select,
#addAuthorModal textarea,
#addPoemModal input,
#addPoemModal select,
#addPoemModal textarea {
    background: white;
    color: #333;
    border: 2px solid #e1e5e9;
    padding: 12px;
    border-radius: 8px;
    width: 100%;
    font-size: 14px;
}

#addAuthorModal input:focus,
#addAuthorModal select:focus,
#addAuthorModal textarea:focus,
#addPoemModal input:focus,
#addPoemModal select:focus,
#addPoemModal textarea:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}



/* Quotes Styles */
.quotes-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    overflow-x: hidden;
    padding: 0 10px;
}

.quotes-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.quotes-content {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.quotes-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.quotes-list {
    display: grid;
    gap: 20px;
}

/* Grouped Quotes Styles */
.quote-group {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.quote-group:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.quote-group-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.quote-group-title {
    color: white;
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.quote-group-author {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin: 5px 0 0 0;
}

.quote-group-count {
    background: rgba(102, 126, 234, 0.2);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-left: 15px;
}

.quote-group-content {
    display: grid;
    gap: 15px;
    margin-bottom: 20px;
}

.quote-group-content .quote-item {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 8px;
    position: relative;
}

.quote-group-content .quote-item:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.quote-group-content .quote-text {
    font-style: italic;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 8px;
    line-height: 1.5;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.quote-group-content .quote-text:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(2px);
}

.quote-group-content .quote-date {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
}

.quote-delete-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.quote-delete-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.quote-group-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Inline quote highlights */
.quote-highlight-inline {
    display: inline;
    font-weight: 600;
    transition: all 0.3s ease;
    border-radius: 4px;
    padding: 2px 4px;
    margin: 0 1px;
    position: relative;
    z-index: 1;
}

.quote-highlight-inline:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.quote-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 22px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 5px solid var(--primary-color);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
}

.quote-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border-left-width: 6px;
}

.quote-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.quote-title {
    font-size: 18px;
    font-weight: 600;
    color: white;
    margin: 0;
}

.quote-author {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin: 0;
}

.quote-text {
    font-style: italic;
    color: rgba(255, 255, 255, 0.95);
    margin: 10px 0;
    line-height: 1.6;
    border-left: 4px solid #ffc107;
    padding-left: 12px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 1.05em;
}

.quote-date {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    margin: 0;
}

/* Quote Modal */
.quote-content {
    text-align: center;
    margin-bottom: 20px;
}

.quote-highlight {
    background: rgba(255, 193, 7, 0.25);
    border-left: 5px solid #ffc107;
    padding: 18px;
    margin: 15px 0;
    border-radius: 10px;
    font-style: italic;
    font-size: 18px;
    line-height: 1.6;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.15);
    position: relative;
}

.quote-highlight::before {
    content: '"';
    position: absolute;
    top: -8px;
    left: 10px;
    font-size: 24px;
    color: #ffc107;
    font-weight: bold;
    background: inherit;
    padding: 0 4px;
}

.quote-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

/* Quote modal actions */
#quoteModal .quote-actions {
    margin-top: 20px;
}

#quoteModal .quote-actions .btn {
    padding: 12px 24px;
    font-size: 1rem;
}

/* Quote modal content styles */
#quoteModal .quote-content {
    text-align: left;
    margin-bottom: 20px;
}

#quoteModal .quote-content h3 {
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 10px;
    font-weight: 600;
}

#quoteModal .quote-content p {
    color: #666;
    margin-bottom: 15px;
    font-style: italic;
}

#quoteModal .quote-text {
    color: #333;
    line-height: 1.8;
    white-space: pre-wrap;
    margin-bottom: 20px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

#quoteModal .quote-highlight {
    background: rgba(255, 193, 7, 0.3);
    border-left: 6px solid #ffc107;
    padding: 20px;
    margin: 20px 0;
    border-radius: 12px;
    font-style: italic;
    font-size: 20px;
    line-height: 1.6;
    color: #333;
    box-shadow: 0 6px 16px rgba(255, 193, 7, 0.2);
    position: relative;
    font-weight: 500;
}

#quoteModal .quote-highlight::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 15px;
    font-size: 28px;
    color: #ffc107;
    font-weight: bold;
    background: inherit;
    padding: 0 6px;
}

.quote-actions .btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.quote-actions .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.quote-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.quote-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.quote-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
}

@keyframes highlightPoem {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
    }
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    z-index: 10000;
    min-width: 200px;
    max-width: 250px;
    pointer-events: auto;
    animation: contextMenuFadeIn 0.2s ease-out;
    transform-origin: top left;
}

@keyframes contextMenuFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-5px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.context-menu-item {
    padding: 10px 16px;
    cursor: pointer;
    color: white;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.context-menu-item:last-child {
    border-bottom: none;
}

.context-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(2px);
}

.context-menu-item i {
    font-size: 14px;
    width: 16px;
    text-align: center;
}

/* Text Selection */
.poem-text {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

.poem-text::selection {
    background: rgba(255, 193, 7, 0.3);
}

.poem-text::-moz-selection {
    background: rgba(255, 193, 7, 0.3);
}

/* Notifications Styles */
.notifications-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
}

.notification-item {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    animation: notificationSlideIn 0.5s ease-out;
    position: relative;
    overflow: hidden;
}

.notification-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
}

.notification-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
}

.notification-item.info::before {
    background: #17a2b8;
}

.notification-item.warning::before {
    background: #ffc107;
}

.notification-item.success::before {
    background: #28a745;
}

.notification-item.error::before {
    background: #dc3545;
}

.notification-item.maintenance::before {
    background: #6f42c1;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.notification-title {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    margin: 0;
    flex: 1;
}

.notification-close {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.notification-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #666;
}

.notification-message {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.notification-date {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
}

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

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

.notification-item.removing {
    animation: notificationSlideOut 0.3s ease-in forwards;
}

/* Notification Type Icons */
.notification-item.info .notification-title::before {
    content: 'ℹ️ ';
}

.notification-item.warning .notification-title::before {
    content: '⚠️ ';
}

.notification-item.success .notification-title::before {
    content: '✅ ';
}

.notification-item.error .notification-title::before {
    content: '❌ ';
}

.notification-item.maintenance .notification-title::before {
    content: '🔧 ';
}

/* Responsive Notifications */
@media (max-width: 768px) {
    .notifications-container {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .notification-item {
        padding: 14px;
        margin-bottom: 10px;
    }
    
    .notification-title {
        font-size: 15px;
    }
    
    .notification-message {
        font-size: 13px;
    }
    
    .quotes-container {
        padding: 0 15px;
    }
    
    .quotes-content {
        padding: 15px;
    }
    
    .quote-group {
        padding: 20px;
    }
    
    .quote-group-content .quote-item {
        padding: 15px;
    }
}

/* Notification Type and Status Badges */
.notification-type-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.notification-type-badge.info {
    background: rgba(23, 162, 184, 0.2);
    color: #17a2b8;
}

.notification-type-badge.warning {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.notification-type-badge.success {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.notification-type-badge.error {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.notification-type-badge.maintenance {
    background: rgba(111, 66, 193, 0.2);
    color: #6f42c1;
}

.notification-status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.notification-status-badge.active {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.notification-status-badge.inactive {
    background: rgba(108, 117, 125, 0.2);
    color: #6c757d;
}

/* Loading message */
.loading-message {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    text-align: center;
}

.loading-message p {
    font-size: 1.1rem;
    color: #666;
    margin: 0;
}

/* Telegram Mini App specific optimizations */
@media (max-width: 480px) {
    .loading-message {
        min-height: 150px;
    }
    
    .loading-message p {
        font-size: 1rem;
    }
}