/* Clean Black Responsive Design - From Scratch */

/* Import Beiruti Font - All Weights */
@import url('https://fonts.googleapis.com/css2?family=Beiruti:wght@400;500;600;700;800&display=swap');

/* Alternative: If Beiruti is not on Google Fonts, you may need to host it locally */
/* @font-face {
    font-family: 'Beiruti';
    src: url('../fonts/Beiruti-Regular.woff2') format('woff2'),
         url('../fonts/Beiruti-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
}
@font-face {
    font-family: 'Beiruti';
    src: url('../fonts/Beiruti-Medium.woff2') format('woff2'),
         url('../fonts/Beiruti-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
}
@font-face {
    font-family: 'Beiruti';
    src: url('../fonts/Beiruti-SemiBold.woff2') format('woff2'),
         url('../fonts/Beiruti-SemiBold.woff') format('woff');
    font-weight: 600;
    font-style: normal;
}
@font-face {
    font-family: 'Beiruti';
    src: url('../fonts/Beiruti-Bold.woff2') format('woff2'),
         url('../fonts/Beiruti-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
}
@font-face {
    font-family: 'Beiruti';
    src: url('../fonts/Beiruti-ExtraBold.woff2') format('woff2'),
         url('../fonts/Beiruti-ExtraBold.woff') format('woff');
    font-weight: 800;
    font-style: normal;
} */

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    background: #ffffff;
    color: #1a1a1a;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Arabic Font - Base (Body Text) */
[dir="rtl"],
[dir="rtl"] *,
[lang="ar"],
[lang="ar"] * {
    font-family: 'Beiruti', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-weight: 400;
}

/* Arabic Headings */
[dir="rtl"] h1,
[dir="rtl"] h2,
[lang="ar"] h1,
[lang="ar"] h2 {
    font-weight: 700 !important;
}

[dir="rtl"] h3,
[dir="rtl"] h4,
[lang="ar"] h3,
[lang="ar"] h4 {
    font-weight: 600 !important;
}

[dir="rtl"] h5,
[dir="rtl"] h6,
[lang="ar"] h5,
[lang="ar"] h6 {
    font-weight: 600 !important;
}

/* Arabic Buttons */
[dir="rtl"] input[type="submit"],
[dir="rtl"] input[type="button"],
[dir="rtl"] button,
[dir="rtl"] .button,
[dir="rtl"] .auth-button,
[lang="ar"] input[type="submit"],
[lang="ar"] input[type="button"],
[lang="ar"] button,
[lang="ar"] .button,
[lang="ar"] .auth-button {
    font-weight: 600 !important;
}

/* Arabic Navigation Links */
[dir="rtl"] nav ul li a,
[dir="rtl"] #header nav ul li a,
[lang="ar"] nav ul li a,
[lang="ar"] #header nav ul li a {
    font-weight: 400 !important;
}

/* Arabic Labels */
[dir="rtl"] label,
[lang="ar"] label {
    font-weight: 500 !important;
}

/* Arabic Language Dropdown */
[dir="rtl"] .lang-switcher select,
[lang="ar"] .lang-switcher select {
    font-weight: 600 !important;
}

/* Arabic Font Size Adjustments */
[dir="rtl"] .lang-switcher select,
[lang="ar"] .lang-switcher select {
    font-size: 15px !important;
}

[dir="rtl"] .auth-button,
[lang="ar"] .auth-button {
    font-size: 15px !important;
}

[dir="rtl"] nav ul li a,
[dir="rtl"] #header nav ul li a,
[lang="ar"] nav ul li a,
[lang="ar"] #header nav ul li a {
    font-size: 15px !important;
}

[dir="rtl"] #header .content h1,
[lang="ar"] #header .content h1 {
    font-size: 2.2rem !important;
}

[dir="rtl"] input[type="submit"],
[lang="ar"] input[type="submit"] {
    font-size: 17px !important;
}

[dir="rtl"] #certificate_search,
[dir="rtl"] input[type="text"],
[lang="ar"] #certificate_search,
[lang="ar"] input[type="text"] {
    font-size: 17px !important;
}

[dir="rtl"] label,
[lang="ar"] label {
    font-size: 15px !important;
}

[dir="rtl"] #footer .copyright,
[dir="rtl"] footer .copyright,
[lang="ar"] #footer .copyright,
[lang="ar"] footer .copyright {
    font-size: 15px !important;
}

body {
    background: #ffffff;
    min-height: 100vh;
}

/* Top Bar Container */
.top-bar {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

/* Language Switcher */
.lang-switcher {
    flex: 0 0 auto;
}

.lang-switcher select {
    padding: 10px 20px;
    background: #ffffff;
    border: 1px solid #1a1a1a;
    border-radius: 4px;
    color: #1a1a1a;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231a1a1a' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
    height: 42px;
    box-sizing: border-box;
    line-height: 1.5;
}

.lang-switcher select:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.lang-switcher select:focus {
    outline: none;
    background-color: rgba(0, 0, 0, 0.05);
    border-color: #1a1a1a;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Auth Links */
.auth-links {
    flex: 0 0 auto;
    display: flex;
    gap: 10px;
}

.auth-links a,
.auth-button {
    padding: 10px 20px;
    background: #ffffff;
    border: 1px solid #1a1a1a;
    border-radius: 4px;
    text-decoration: none;
    color: #1a1a1a;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    display: inline-block;
    height: 42px;
    box-sizing: border-box;
    line-height: 1.5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-links a:hover,
.auth-button:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* RTL Support */
[dir="rtl"] .top-bar {
    flex-direction: row-reverse;
}

[dir="rtl"] .lang-switcher select {
    background-position: left 15px center;
    padding-left: 40px;
    padding-right: 20px;
}

/* Wrapper */
#wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 80px 20px 40px;
    overflow: visible;
}

/* Header */
#header {
    width: 100%;
    max-width: 1200px;
    text-align: center;
    overflow: visible;
}

/* Logo */
#header .logo {
    width: 100px;
    height: 100px;
    margin: 0 auto 30px;
}

#header .logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Content */
#header .content {
    margin-bottom: 40px;
}

#header .content .inner {
    width: 100%;
}

#header .content h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 30px;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 3px;
}

#header .content img.main-icon,
#header .content img[alt="Icon"] {
    max-width: 200px;
    width: 25%;
    height: auto;
    margin: 20px auto;
    display: block;
}

/* Banner Slider */
.banner-slider {
    width: 100%;
    max-width: 800px;
    margin: 30px auto;
}

.banner-slider img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.banner-item {
    display: none;
}

.banner-item:first-child {
    display: block;
}

/* Search Section */
#header .content p {
    margin: 40px 0;
}

#certificate_search,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
textarea,
select {
    width: 100%;
    max-width: 400px;
    padding: 15px 20px;
    background: #ffffff;
    border: 1px solid #1a1a1a;
    border-radius: 4px;
    color: #1a1a1a;
    font-size: 16px;
    text-align: center;
    margin: 10px auto;
    display: block;
    transition: all 0.3s ease;
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder,
textarea::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    outline: none;
    background: #f8f8f8;
    border-color: #1a1a1a;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

input[type="submit"],
input[type="button"],
button,
.button {
    padding: 12px 30px;
    background: #1a1a1a;
    border: 1px solid #1a1a1a;
    border-radius: 4px;
    color: #ffffff;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px auto;
    display: block;
    text-decoration: none;
}

input[type="submit"]:hover,
input[type="button"]:hover,
button:hover,
.button:hover {
    background: #000000;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Form Labels */
label {
    display: block;
    color: #1a1a1a;
    margin: 15px 0 5px;
    text-align: center;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Navigation */
#header nav,
nav {
    margin-top: 40px;
}

#header nav ul,
nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    border: none;
    border-radius: 0;
    overflow: visible;
    padding: 0;
    margin: 0;
    width: 100%;
}

#header nav ul li,
nav ul li {
    flex: 0 1 auto;
    min-width: 0;
    border: 1px solid #1a1a1a !important;
    border-radius: 4px;
    box-sizing: border-box;
    overflow: visible;
}


#header nav ul li:empty,
#header nav ul li:not(:has(a)),
nav ul li:empty,
nav ul li:not(:has(a)) {
    display: none !important;
}

#header nav ul li a,
nav ul li a {
    display: block;
    padding: 15px 20px;
    color: #1a1a1a;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 14px;
    transition: all 0.3s ease;
    text-align: center;
    white-space: nowrap;
    box-sizing: border-box;
}

#header nav ul li a:hover,
nav ul li a:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* RTL Navigation */
[dir="rtl"] #header nav ul,
[dir="rtl"] nav ul {
    direction: rtl;
    overflow: visible;
}

[dir="rtl"] #header nav ul li,
[dir="rtl"] nav ul li {
    border: 1px solid #1a1a1a !important;
    border-radius: 4px;
}

[dir="rtl"] #header nav ul li:first-child,
[dir="rtl"] nav ul li:first-child {
    border: 1px solid #1a1a1a !important;
}

[dir="rtl"] #header nav ul li:last-child,
[dir="rtl"] nav ul li:last-child {
    border: 1px solid #1a1a1a !important;
}

/* Social Links (Second Nav Row) */
#header nav ul + br + ul {
    margin-top: 20px;
}

/* Footer */
#footer,
footer {
    margin-top: 60px;
    text-align: center;
    padding: 20px;
}

#footer .copyright,
footer .copyright {
    color: rgba(0, 0, 0, 0.7);
    font-size: 14px;
}

#footer .copyright img,
footer .copyright img {
    margin-bottom: 10px;
}

#footer .copyright a,
footer .copyright a {
    color: #1a1a1a;
    text-decoration: none;
}

#footer .copyright a:hover,
footer .copyright a:hover {
    text-decoration: underline;
}

/* Background */
#bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    z-index: -1;
}

/* Container for admin pages and other pages */
.container,
.admin-container {
    max-width: 1200px;
    margin: 100px auto;
    padding: 40px 20px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

table th,
table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
}

table th {
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.05);
}

table tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

/* Links */
a {
    color: #1a1a1a;
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: #000000;
    text-decoration: underline;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    color: #1a1a1a;
    margin: 20px 0;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

/* Error and Success Messages */
.error,
.success {
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 4px;
    border: 1px solid;
    text-align: center;
}

.error {
    background: rgba(255, 0, 0, 0.1);
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.success {
    background: rgba(0, 255, 0, 0.1);
    border-color: #51cf66;
    color: #51cf66;
}

/* Responsive Design */

/* Tablet */
@media screen and (max-width: 768px) {
    #header .content h1 {
        font-size: 2rem;
        letter-spacing: 2px;
    }
    
    #header nav ul,
    nav ul {
        flex-direction: column;
    }
    
    #header nav ul li,
    nav ul li {
        border: 1px solid #1a1a1a;
        border-radius: 4px;
        width: 100%;
    }
    
    .top-bar {
        position: relative;
        top: 0;
        left: 0;
        right: 0;
        justify-content: center;
        margin: 10px auto;
        max-width: 500px;
    }
    
    [dir="rtl"] .top-bar {
        flex-direction: row-reverse;
    }
    
    #wrapper {
        padding-top: 20px;
    }
    
    .container,
    .admin-container {
        margin: 50px auto;
        padding: 30px 15px;
    }
}

/* Mobile */
@media screen and (max-width: 480px) {
    .top-bar {
        position: relative;
        top: 0;
        left: 0;
        right: 0;
        justify-content: center;
        margin: 10px auto;
        max-width: 400px;
        flex-wrap: nowrap;
    }
    
    .lang-switcher select,
    .auth-links a,
    .auth-button {
        max-width: 180px;
        min-width: 120px;
        flex: 1;
    }
    
    [dir="rtl"] .top-bar {
        flex-direction: row-reverse;
    }
    
    #header .content h1 {
        font-size: 1.5rem;
        letter-spacing: 1px;
        margin-bottom: 20px;
    }
    
    #certificate_search,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="number"],
    textarea,
    select {
        max-width: 100%;
        padding: 12px 15px;
        font-size: 14px;
    }
    
    input[type="submit"],
    input[type="button"],
    button,
    .button {
        padding: 10px 20px;
        font-size: 14px;
        width: 100%;
        max-width: 300px;
    }
    
    #header nav ul li a,
    nav ul li a {
        padding: 12px 15px;
        font-size: 12px;
    }
    
    #wrapper {
        padding: 20px 15px;
    }
    
    #header .logo {
        width: 80px;
        height: 80px;
    }
    
    .container,
    .admin-container {
        margin: 30px auto;
        padding: 20px 15px;
    }
    
    table {
        font-size: 12px;
    }
    
    table th,
    table td {
        padding: 10px;
    }
}

/* Preload State */
body.is-preload * {
    animation: none !important;
    transition: none !important;
}
