/* Legacy Compatible CSS */
body {
    font-family: Arial, sans-serif;
    background-color: #0a0a0a;
    color: #f8fafc;
    margin: 0;
    padding: 0;
}

.hidden {
    display: none !important;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Setup Screen */
.setup-container {
    width: 400px;
    margin: 50px auto;
    padding: 30px;
    background: #1a1a1a;
    border: 1px solid #333;
    text-align: center;
}

.app-logo {
    font-size: 24px;
    font-weight: bold;
    color: #3b82f6;
    margin-bottom: 20px;
}

.input-group {
    text-align: left;
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    color: #94a3b8;
}

input {
    width: 90%;
    padding: 10px;
    background: #2a2a2a;
    border: 1px solid #444;
    color: #fff;
}

.btn-primary, .btn-secondary, .btn-danger {
    width: 100%;
    padding: 10px;
    border: none;
    color: #fff;
    cursor: pointer;
    margin-top: 10px;
}

.btn-primary { background: #3b82f6; }
.btn-secondary { background: #2a2a2a; }
.btn-danger { background: #ef4444; }

/* Header */
.app-header {
    background: #111;
    border-bottom: 1px solid #333;
    height: 50px;
    position: relative;
}

.header-left {
    position: absolute;
    left: 10px;
    top: 10px;
}

.header-right {
    position: absolute;
    right: 10px;
    top: 10px;
}

#page-title {
    display: inline-block;
    margin: 0 10px;
    font-size: 18px;
    font-weight: bold;
}

.icon-btn {
    background: transparent;
    border: 1px solid #444;
    color: #fff;
    padding: 5px 10px;
    cursor: pointer;
}

/* Grid/List */
#catalog-container {
    padding: 20px;
}

.list-item {
    background: #1a1a1a;
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid #333;
    cursor: pointer;
    overflow: hidden;
}

.item-info {
    float: left;
    width: 80%;
}

.item-title {
    font-weight: bold;
    color: #fff;
}

.item-subtitle {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 5px;
}

.item-icon {
    float: right;
    font-size: 20px;
}

/* Reader */
#reader-screen {
    background: #000;
    z-index: 1000;
}

#reader-controls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 10px;
    background: #111;
    color: #fff;
    z-index: 1001;
}

#reader-title {
    margin-left: 20px;
}

#page-counter {
    position: absolute;
    right: 40px;
}

#reader-viewport {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    overflow: hidden;
    text-align: center;
}

/* Object-fit hack for legacy */
#current-page {
    position: absolute;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
}

#reader-navigation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.nav-area {
    position: absolute;
    top: 0;
    height: 100%;
    width: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
}
.nav-area.left { left: 0; }
.nav-area.right { right: 0; }

/* Modals */
.modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    filter: alpha(opacity=80);
    -moz-opacity: 0.8;
    opacity: 0.8;
    z-index: 2000;
}

.modal-content {
    background: #1a1a1a;
    padding: 20px;
    width: 300px;
    margin: 100px auto;
    border: 1px solid #555;
    position: relative;
    z-index: 2001;
    opacity: 1; 
    filter: alpha(opacity=100);
}
