html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  line-height: 1.6;
  padding-left: 40px;
  padding-right: 40px;
}

.form-floating > .form-control-plaintext::placeholder, 
.form-floating > .form-control::placeholder {
  color: #6c757d; /* IE fallback for --bs-secondary-color */
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, 
.form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Article creation form styles */
.card.article-form {
    border-radius: 0.5rem;
    border: none;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
    filter: progid:DXImageTransform.Microsoft.Shadow(color='#1a000000', Direction=135, Strength=5); /* IE9 */
}

.card.article-form .card-header {
    border-radius: 0.5rem 0.5rem 0 0 !important;
    padding: 1.5rem;
}

.card.article-form .card-body {
    padding: 2rem;
}

.form-control-lg {
    padding: 1rem;
    font-size: 1.1rem;
}

textarea.form-control {
    min-height: 400px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.form-label {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    display: block;
}

/* CKEditor container styling */
.cke_chrome {
    border-radius: 0.375rem !important;
    border: 1px solid #dee2e6 !important;
    box-shadow: none !important;
}

/* CKEditor table styling */
.cke_editable table td, 
.cke_editable table th,
.cke_wysiwyg_frame body table td,
.cke_wysiwyg_frame body table th,
.cke_contents_ltr table td,
.cke_contents_ltr table th,
.cke_show_borders table td,
.cke_show_borders table th,
figure.table table td,
figure.table table th {
    padding: 0.05rem 0.2rem !important;
    line-height: 1.2 !important;
    height: auto !important;
    min-height: auto !important;
}

/* Table styles for article content */
table {
    width: 100%;
    margin: 2rem 0;
    border-collapse: collapse;
    background-color: #fff;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
    filter: progid:DXImageTransform.Microsoft.Shadow(color='#1a000000', Direction=135, Strength=5); /* IE9 */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

table td, table th {
    padding: 1rem;
    vertical-align: middle;
    border: 1px solid #e9ecef;
    line-height: 1.3;
}

table thead th {
    vertical-align: middle;
    border-bottom: 2px solid #dee2e6;
    background-color: #f8f9fa;
    font-weight: 700;
    color: #212529;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.875rem;
}

table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

table tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

table.table-bordered,
figure.table table.table-bordered {
    border: 1px solid #dee2e6;
}

table.table-bordered td,
table.table-bordered th,
figure.table table.table-bordered td,
figure.table table.table-bordered th {
    border: 1px solid #dee2e6;
}

table.table-hover tbody tr:hover,
figure.table table.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

table.table-striped tbody tr:nth-of-type(odd),
figure.table table.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Responsive tables */
@media (max-width: 767.98px) {
    table,
    figure.table table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -ms-overflow-style: -ms-autohiding-scrollbar; /* IE10+ */
        -webkit-overflow-scrolling: touch;
    }
    
    table thead,
    figure.table table thead {
        display: none;
    }
    
    table tbody tr,
    figure.table table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: 0.25rem;
    }
    
    table tbody td,
    figure.table table tbody td {
        display: block;
        text-align: right;
        padding-left: 50%;
        position: relative;
        border: none;
        border-bottom: 1px solid #dee2e6;
    }
    
    table tbody td::before {
        content: attr(data-label);
        position: absolute;
        left: 0.75rem;
        width: calc(50% - 0.75rem);
        padding-right: 0.75rem;
        text-align: left;
        font-weight: 600;
        color: #495057;
    }
}

/* Article page styles */
.article-title {
    text-align: center;
    margin-bottom: 1.5rem;
}

.article-meta {
    text-align: center;
    color: #6c757d;
    margin-bottom: 1.5rem;
}

.back-link-container {
    display: -ms-flexbox; /* IE10 */
    display: flex;
    -ms-flex-pack: end; /* IE10 */
    justify-content: flex-end;
    margin-top: 2rem;
    padding-right: 1rem;
    width: 100%;
}

/* Article page back link styles */
.article-container .back-link {
    display: inline-block;
    margin-top: 2rem;
    float: right;
    clear: both;
}

/* Announcement list specific styles */
.table.rounded {
    border-radius: 0.5rem !important;
    overflow: hidden;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    filter: progid:DXImageTransform.Microsoft.Shadow(color='#1a000000', Direction=135, Strength=10); /* IE9 */
}

.table.rounded thead th {
    background-color: #0d6efd;
    color: white;
    font-weight: 600;
    border-bottom: none;
}

.table.rounded tbody tr {
    background-color: white !important;
}

.table.table-striped.table-hover.table-bordered.rounded td,
.table.table-striped.table-hover.table-bordered.rounded th {
    padding: 0.5rem 0.5rem !important;
    line-height: 1.2 !important;
}

.table.rounded .btn-link {
    padding: 0.5rem 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.2s;
    margin-right: 0.5rem;
}

.table.rounded .btn-link:hover {
    background-color: rgba(13, 110, 253, 0.1);
    text-decoration: none;
}

.table.rounded .btn-link:last-child {
    margin-right: 0;
    color: #dc3545;
}

.table.rounded .btn-link:last-child:hover {
    background-color: rgba(220, 53, 69, 0.1);
}

/* Login page styles */
.login-container {
    display: -ms-flexbox; /* IE10 */
    display: flex;
    -ms-flex-align: center; /* IE10 */
    align-items: center;
    -ms-flex-pack: center; /* IE10 */
    justify-content: center;
    min-height: calc(100vh - 120px);
    padding: 2rem;
    background-color: #f8f9fa;
}

.login-box {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.login-box h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #212529;
}

.login-box .form-group {
    margin-bottom: 1.5rem;
}

.login-box .form-control {
    height: 45px;
    border-radius: 0.25rem;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.login-box .form-control:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.login-box .btn-primary {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 0.25rem;
    background-color: #0d6efd;
    border: none;
    transition: background-color 0.15s ease-in-out;
}

.login-box .btn-primary:hover {
    background-color: #0b5ed7;
}

@media (max-width: 576px) {
    .login-container {
        padding: 1rem;
    }
    
    .login-box {
        padding: 1.5rem;
    }
}
