:root {
    --base03:    #002b36;
    --base02:    #073642;
    --base01:    #586e75;
    --base00:    #657b83;
    --base0:     #839496;
    --base1:     #93a1a1;
    --base2:     #eee8d5;
    --base3:     #fdf6e3;
    --yellow:    #b58900;
    --orange:    #cb4b16;
    --red:       #dc322f;
    --magenta:   #d33682;
    --violet:    #6c71c4;
    --blue:      #268bd2;
    --cyan:      #2aa198;
    --green:     #859900;
}
html {
    height: 100%;
}
html[style*="color-scheme: dark"] {
    --isdark: 1;
    --islight: 0;
}
html[style*="color-scheme: light"] {
    --isdark: 0;
    --islight: 1;
}
body{
    vertical-align: middle;
    margin: auto;
    padding: 20px;
    max-width:640px ;
    color: light-dark(var(--base00), var(--base0));
    background-color: light-dark(var(--base3), var(--base03));
    font-family: "Open Sans", sans-serif;
}
.hl {
    color: light-dark(var(--base01), var(--base1));
    background-color: light-dark(var(--base2), var(--base02));
}

fieldset {
    border-color: light-dark(var(--base00), var(--base0));
    border-style: solid;
    border-radius: 5px;
    margin: 10px 0;
}

legend {
    margin: 0 auto;
    padding: 0 10px;
    color: light-dark(var(--base01), var(--base1));
}

#header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

#hdtxt {
    align-content: flex-start;
    flex-basis: 80%;
    text-align: left;
    justify-content: left;
}

.flex {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}    
.row {
    flex-flow: row wrap;
}
.col {
    flex-flow: column wrap;
}
.rowrtl {
    flex-flow: row-reverse wrap;
}
.cflex {
    align-content: center;
}

.btn {
    border-style: hidden;
    line-height: normal;
    cursor: pointer;
}
.btn:hover {
    border-style: solid;
}
#theme-toggle {
    color: light-dark(var(--base01), var(--base1));
    background-color: transparent;
    font-size: 1.2em;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    margin-left: 20px;
}
#theme-toggle:hover {
    background-color: light-dark(var(--base2), var(--base02));
    transform: scale(1.1);
}

.widgelet {
    flex: 1;
    min-width: 100px;
    margin: 5px;
    text-align: center;
    transition: all 0.3s ease;
}
.icon {
    width: 40px;
    margin: 10px;
}
.invdark {
    filter: invert(var(--isdark));
}

.widgelet:hover {
    transform: scale(1.05);
    background-color: light-dark(var(--base2), var(--base02));
}

.prayer-time {
    font-size: 1.2em;
    margin: 10px 0;
}

.toggle-btn {
    background-color: transparent;
    border: 1px solid light-dark(var(--base00), var(--base0));
    color: light-dark(var(--base00), var(--base0));
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    background-color: light-dark(var(--base2), var(--base02));
}

.toggle-btn.active {
    background-color: light-dark(var(--base01), var(--base1));
    color: light-dark(var(--base3), var(--base03));
}

.asr-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.asr-label {
    color: light-dark(var(--base01), var(--base1));
    font-size: 0.9em;
}

.lang-toggle {
    background-color: transparent;
    border: 1px solid light-dark(var(--base00), var(--base0));
    color: light-dark(var(--base00), var(--base0));
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 20px;
}

.lang-toggle:hover {
    background-color: light-dark(var(--base2), var(--base02));
}

[dir="rtl"] body {
    font-family: "Open Sans", "Noto Naskh Arabic", sans-serif;
}

[dir="rtl"] .lang-toggle {
    margin-left: 0;
    margin-right: 20px;
}

[dir="rtl"] #theme-toggle {
    margin-left: 0;
    margin-right: 20px;
}

.date-display {
    text-align: center;
    margin: 10px 0;
    padding: 10px;
    background-color: light-dark(var(--base2), var(--base02));
    border-radius: 5px;
}

.date-display span {
    margin: 0 10px;
    color: light-dark(var(--base01), var(--base1));
}

/* Tools Section */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 1em 0;
}

.tool-card {
    text-decoration: none;
    color: inherit;
    background-color: light-dark(var(--base2), var(--base02));
    padding: 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.tool-card:hover {
    transform: translateY(-2px);
    border-color: light-dark(var(--base00), var(--base0));
    background-color: light-dark(var(--base3), var(--base03));
}

.tool-card h3 {
    margin: 0 0 10px 0;
    color: light-dark(var(--blue), var(--blue));
}

.tool-card p {
    margin: 0;
    font-size: 0.9em;
    color: light-dark(var(--base01), var(--base1));
}

/* Section Styles */
section {
    margin: 2em 0;
}

section h2 {
    color: light-dark(var(--base01), var(--base1));
    margin-bottom: 1em;
}

/* Contact Section */
#contact {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5em 1.5em;
}

#contact h2 {
    width: 100%;
    margin-bottom: 0.5em;
}

#contact a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    gap: 0.3em;
}

#contact a:hover {
    color: light-dark(var(--blue), var(--blue));
}

#contact .icon {
    width: 20px;
    margin: 0;
}

/* Experience Section */
.experience-item {
    margin-bottom: 2em;
    padding: 1em;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.experience-item:hover {
    background-color: light-dark(var(--base2), var(--base02));
}

.experience-item h3 {
    color: light-dark(var(--blue), var(--blue));
    margin: 0 0 0.5em 0;
}

.company {
    font-weight: bold;
    color: light-dark(var(--base01), var(--base1));
}

.date {
    color: light-dark(var(--base01), var(--base1));
    font-size: 0.9em;
    margin: 0.3em 0;
}

/* Publications Section */
.publication {
    margin: 1em 0;
    padding: 1em;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.publication:hover {
    background-color: light-dark(var(--base2), var(--base02));
}

.publication p {
    margin: 0;
}

.publication em {
    color: light-dark(var(--cyan), var(--cyan));
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 1em 0;
}

.skill-category {
    background-color: light-dark(var(--base2), var(--base02));
    padding: 1.5em;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.skill-category:hover {
    transform: translateY(-2px);
}

.skill-category h3 {
    color: light-dark(var(--blue), var(--blue));
    margin: 0 0 1em 0;
}

.skill-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.skill-list li {
    margin: 0.5em 0;
    color: light-dark(var(--base00), var(--base0));
}
