html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
    display: block;
}
body {
    line-height: 1;
}
ol, ul {
    list-style: none;
}
table {
    border-collapse: collapse;
    border-spacing: 0;
}

@font-face {
    font-family: quicksand;
    src: url('res/quicksand.ttf');
}

@font-face {
    font-family: nunito;
    src: url('res/Nunito-Regular.ttf');
}

*:focus {
    outline:none;
}

body {
    font-family:nunito;
    background-color: var(--bg-color);
    color:var(--font-color);
}

input,select {
    background-color: var(--inp-bg);
    border: solid 1px var(--inp-bd);
    border-radius: 8px;
    padding: 9px 7px;
    font-size: 1em;
    color: var(--font-color);
    display: block;
    margin: 7px 5px; /* 7px auto */
    transition: all .2s ease-in-out;
    max-width: calc(100% - 14px);
}
input:hover {
    background-color: var(--inp-hover-bg);
}
input:focus {
    border: solid 1px var(--inp-focus-bd);
    background-color: var(--inp-focus-bg);
}
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active{
    -webkit-background-clip: text;
    -webkit-text-fill-color: var(--font-color);
}



@media only screen and (max-width: 1200px) {
    
}

/* Reading App Styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.app-header {
    background-color: var(--bg-dark);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    font-family: quicksand;
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.main-nav {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    color: var(--font-color);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.nav-btn:hover {
    background: var(--btn-hover-bg);
}

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

/* Main Content */
.app-main {
    min-height: calc(100vh - 80px);
}

.section {
    display: none;
    padding: 2rem 0;
}

.section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 2rem;
    font-weight: bold;
    color: var(--font-color);
}

/* View Controls */
.view-controls {
    display: flex;
    gap: 0.25rem;
}

.view-btn {
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    color: var(--font-color);
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.view-btn:hover {
    background: var(--btn-hover-bg);
}

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

/* Content Tabs */
.content-tabs, .search-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    overflow-x: auto;
}

.tab-btn, .search-tab-btn {
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    color: var(--font-color);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn:hover, .search-tab-btn:hover {
    background: var(--btn-hover-bg);
}

.tab-btn.active, .search-tab-btn.active {
    background: var(--primary-color);
    color: white;
}

/* Books Grid */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.books-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.book-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.book-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.book-cover {
    position: relative;
    margin-bottom: 1rem;
}

.book-cover img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
}

.book-status {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 0.25rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.book-info {
    text-align: center;
}

.book-title {
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-author {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.book-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.content-type {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.progress {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s;
}

/* Search */
.search-container {
    margin-bottom: 2rem;
}

.search-box {
    display: flex;
    gap: 0.5rem;
    max-width: 600px;
}

.search-box input {
    flex: 1;
    margin: 0;
}

.search-box button {
    background: var(--primary-color);
    border: none;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
}

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.search-result-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    gap: 1rem;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.search-result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.add-result-btn-corner {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--primary-color, #007bff);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.add-result-btn-corner:hover {
    background: var(--primary-hover, #0056b3);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}

.add-result-btn-corner:active {
    transform: scale(0.95);
}

.add-result-btn-corner i {
    font-size: 14px;
}

.result-cover img {
    width: 80px;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
}

.result-info {
    flex: 1;
}

.result-title {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

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

.result-description {
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
}

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

.result-year, .result-source {
    background: var(--bg-light);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.add-result-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* Add Content */
.add-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.add-option {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.add-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.add-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.add-option h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.add-option p {
    color: var(--text-secondary);
}

/* Reader */
.reader {
    padding: 0;
}

.reader-header {
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.back-btn {
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    color: var(--font-color);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.book-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.reader-controls {
    display: flex;
    gap: 0.5rem;
}

.reader-controls button {
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    color: var(--font-color);
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
}

.reader-content {
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.reader-text {
    line-height: 1.8;
    font-size: 1.1rem;
}

.chapter-content h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--primary-color);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s;
}

.modal.show {
    visibility: visible;
    opacity: 1;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.modal-header h3 {
    font-size: 1.5rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.form-group textarea {
    width: 100%;
    min-height: 100px;
    resize: vertical;
    background-color: var(--inp-bg);
    border: solid 1px var(--inp-bd);
    border-radius: 8px;
    padding: 9px 7px;
    font-size: 1em;
    color: var(--font-color);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

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

.btn-secondary {
    background: var(--btn-bg);
    color: var(--font-color);
    border: 1px solid var(--btn-border);
}

.btn:hover {
    transform: translateY(-1px);
}

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s;
}

.loading-overlay.show {
    visibility: visible;
    opacity: 1;
}

.loading-spinner {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
}

.loading-spinner i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.loading, .empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 3000;
    transform: translateX(100%);
    transition: transform 0.3s;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    border-color: #22c55e;
    color: #22c55e;
}

.notification-error {
    border-color: #ef4444;
    color: #ef4444;
}

@media only screen and (max-width: 1200px) {
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media only screen and (max-width: 700px) {
    .container {
        padding: 0 15px;
    }

    .app-header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .main-nav {
        width: 100%;
        justify-content: center;
    }

    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .search-results-grid {
        grid-template-columns: 1fr;
    }

    .add-options {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }

    .reader-header .container {
        flex-direction: column;
        gap: 1rem;
    }
}

