body {
    font-family: sans-serif;
    margin: 0;
    background: #f8f8f8;
}

header {
    background: #004477;
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: 0;
    font-size: 1.2em;
}

.logout {
    color: white;
    text-decoration: none;
}

.container {
    display: flex;
    height: calc(100vh - 60px);
}

.sidebar {
    width: 320px;
    background: #ffffff;
    border-right: 1px solid #ccc;
    overflow-y: auto;
    padding: 10px;
}

.sidebar h2 {
    margin-top: 0;
}

.viewer {
    flex: 1;
    background: #e9e9e9;
    display: flex;
    justify-content: center;
    align-items: center;
}

.viewer iframe {
    border: none;
}

ul {
    list-style: none;
    padding: 0;
}

li {
    padding: 8px;
    margin-bottom: 4px;
}

li a {
    color: #333;
    text-decoration: none;
}

li.active-article {
    background: #cde4ff;
    border-radius: 4px;
}

.search-box input {
    width: 100%;
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.login-container {
    max-width: 400px;
    margin: 80px auto;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.login-container input {
    width: 100%;
    padding: 8px;
    margin: 10px 0;
}

.login-container button {
    width: 100%;
    padding: 8px;
    background: #004477;
    color: white;
    border: none;
    cursor: pointer;
}

.error {
    color: red;
}

/* Login Selection Styles */
.login-selection-container {
    max-width: 500px;
    margin: 60px auto;
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.login-selection-container h1 {
    color: #004477;
    margin-bottom: 10px;
}

.login-selection-container p {
    color: #666;
    margin-bottom: 30px;
}

.button-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-button {
    display: flex;
    align-items: center;
    padding: 20px;
    background: #f9f9f9;
    border: 2px solid #ddd;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
}

.login-button:hover {
    background: #004477;
    color: white;
    border-color: #004477;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,68,119,0.3);
}

.button-icon {
    font-size: 2.5em;
    margin-right: 20px;
    min-width: 60px;
}

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

.button-text h3 {
    margin: 0 0 5px 0;
    font-size: 1.2em;
}

.button-text p {
    margin: 0;
    font-size: 0.9em;
    opacity: 0.8;
}

.back-link {
    margin-top: 20px;
}

.back-link a {
    color: #004477;
    text-decoration: none;
}

.back-link a:hover {
    text-decoration: underline;
}

/* Mobile Login Styles */
.mobile-body {
    background: linear-gradient(135deg, #004477 0%, #0066aa 100%);
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile browsers */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
}

.mobile-login-container {
    width: 100%;
    max-width: 320px;
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    box-sizing: border-box;
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
}

.mobile-header {
    text-align: center;
    margin-bottom: 20px;
}

.mobile-header h1 {
    font-size: 1.3em;
    color: #004477;
    margin: 0 0 10px 0;
    line-height: 1.2;
}

.mobile-badge {
    background: #e8f4fd;
    color: #004477;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
    display: inline-block;
    margin-top: 4px;
}

.mobile-form {
    margin-bottom: 16px;
}

.mobile-input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}

.mobile-input-group input:focus {
    outline: none;
    border-color: #004477;
}

.mobile-input-group button {
    width: 100%;
    padding: 12px 16px;
    background: #004477;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
}

.mobile-input-group button:hover {
    background: #003366;
}

.mobile-input-group button:active {
    transform: translateY(1px);
}

.mobile-error {
    color: #e74c3c;
    background: #fdf2f2;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9em;
    margin-top: 12px;
    text-align: center;
}

.mobile-back {
    text-align: center;
}

.mobile-back a {
    color: #004477;
    text-decoration: none;
    font-size: 0.9em;
}

.mobile-back a:hover {
    text-decoration: underline;
}

/* Mobile Main Page Styles */
.mobile-main-body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8f9fa;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile browsers */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
}

.mobile-header {
    background: linear-gradient(135deg, #004477 0%, #0066aa 100%);
    color: white;
    padding: 0;
    position: relative;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    flex-shrink: 0;
    z-index: 100;
}

.mobile-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    min-height: 44px;
    box-sizing: border-box;
}

.mobile-header h1 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
}

.mobile-menu-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
}

.mobile-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.mobile-menu.show {
    transform: translateY(0);
}

.mobile-menu a {
    display: block;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #eee;
}

.mobile-menu a:hover {
    background: #f5f5f5;
}

.mobile-tabs {
    display: flex;
    background: white;
    border-bottom: 1px solid #ddd;
    padding: 0;
    flex-shrink: 0;
    z-index: 10;
}

.tab-btn {
    flex: 1;
    padding: 10px 4px;
    background: none;
    border: none;
    color: #666;
    font-size: 13px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
}

.tab-btn.active {
    color: #004477;
    border-bottom-color: #004477;
    background: #f8f9fa;
}

.tab-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tab-content {
    display: none;
    flex: 1;
    overflow: hidden;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

.mobile-search {
    padding: 8px 16px;
    background: white;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.mobile-search input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}

.mobile-articles {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    padding-bottom: 20px;
    -webkit-overflow-scrolling: touch;
}

.mobile-article-item {
    background: white;
    margin-bottom: 8px;
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-article-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.mobile-article-item.active {
    border: 2px solid #004477;
    background: #f0f7ff;
}

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

.article-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.article-date {
    font-size: 12px;
    color: #666;
}

.article-badge {
    font-size: 9px;
    padding: 3px 8px;
    border-radius: 6px;
    color: white;
    align-self: flex-start;
    font-weight: bold;
    white-space: nowrap;
    line-height: 1.2;
}

.article-source {
    font-size: 11px;
    color: #888;
    text-align: right;
    flex-shrink: 0;
    white-space: nowrap;
}

.badge-text.prim {
    color: #007bff;
    font-weight: 600;
}

.badge-text.sec {
    color: #6c757d;
    font-weight: 600;
}

.article-title {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    line-height: 1.3;
    margin-bottom: 8px;
}

.article-actions {
    text-align: right;
}

.view-pdf {
    font-size: 12px;
    color: #004477;
    font-weight: 500;
}

.mobile-pdf-header {
    background: white;
    padding: 8px 16px;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    min-height: 44px;
    box-sizing: border-box;
}

.back-to-articles {
    background: #f5f5f5;
    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 6px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
}

.pdf-info {
    flex: 1;
    margin-left: 12px;
    font-size: 12px;
    min-width: 0;
    overflow: hidden;
}

.pdf-info strong {
    display: block;
    color: #333;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pdf-info small {
    color: #666;
}

.mobile-pdf-viewer {
    flex: 1;
    background: #e9e9e9;
    overflow: hidden;
}

#pdf-container {
    width: 100%;
    height: 100%;
}

.no-pdf {
    text-align: center;
    color: #666;
    padding: 40px 20px;
    margin: 0;
}

/* Responsive adjustments for larger screens */
@media (min-width: 768px) {
    .button-container {
        flex-direction: row;
        gap: 30px;
    }
    
    .login-button {
        flex: 1;
        flex-direction: column;
        text-align: center;
        padding: 30px 20px;
    }
    
    .button-icon {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .button-text {
        text-align: center;
    }
    
    /* Mobile main page adjustments for tablets */
    .mobile-main-body {
        max-width: 768px;
        margin: 0 auto;
    }
    
    .mobile-articles {
        padding: 12px;
    }
    
    .mobile-article-item {
        padding: 16px;
    }
    
    .article-title {
        font-size: 15px;
    }
}
