@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&display=swap');

:root {
    --ios-bg: #f2f2f7;
    /* iOS System Gray 6 */
    --ios-card-bg: #ffffff;
    --ios-text: #000000;
    --ios-primary: #007aff;
    /* iOS Blue */
    --ios-secondary: #5856d6;
    /* iOS Indigo */
    --ios-success: #34c759;
    --ios-danger: #ff3b30;
    --ios-warning: #ff9500;
    --ios-gray: #8e8e93;
    --ios-light-gray: #e5e5ea;
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --font-family: 'Cairo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Dark Mode Logic (optional later) */
@media (prefers-color-scheme: dark) {
    /* define dark mode vars if needed */
}

* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

input,
button,
select,
textarea {
    font-family: inherit;
}

body {
    background-color: var(--ios-bg);
    color: var(--ios-text);
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    direction: rtl;
    /* Default RTL as requested */
    font-size: 15px;
}

/* LTR Support */
body.ltr {
    direction: ltr;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Authentication Layout */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at top left, #eef2f3, #e6e9f0);
}

.auth-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 40px;
    border-radius: 24px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 30px;
    background: linear-gradient(135deg, var(--ios-primary), var(--ios-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
    text-align: right;
}

body.ltr .form-group {
    text-align: left;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: rgba(118, 118, 128, 0.12);
    font-size: 16px;
    transition: all 0.3s ease;
    font-family: var(--font-family);
}

.form-input:focus {
    background: #fff;
    border-color: var(--ios-primary);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.15);
    outline: none;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-md);
    background: var(--ios-primary);
    color: white;
    font-weight: 600;
    border: none;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.1s ease, opacity 0.2s;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:hover {
    opacity: 0.9;
}

/* Dashboard Layout */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 260px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(0, 0, 0, 0.05);
    /* for RTL */
    padding: 20px;
    display: flex;
    flex-direction: column;
}

body.ltr .sidebar {
    border-left: none;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.workspace-title {
    font-size: 28px;
    font-weight: 800;
}

/* Nav */
.nav-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: var(--radius-md);
    margin-bottom: 5px;
    color: var(--ios-text);
    font-weight: 500;
    transition: background 0.2s;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(0, 0, 0, 0.05);
}

.nav-icon {
    margin-left: 12px;
    /* RTL */
    font-size: 20px;
}

body.ltr .nav-icon {
    margin-left: 0;
    margin-right: 12px;
}

/* Alert */
.alert {
    padding: 15px;
    border-radius: var(--radius-md);
    background: rgba(255, 59, 48, 0.1);
    color: var(--ios-danger);
    margin-bottom: 20px;
    font-size: 14px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Animated Background */
.animated-bg {
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Copyright Footer */
.copyright-text {
    font-size: 11px;
    color: var(--ios-gray);
    text-align: center;
    margin-top: 20px;
    opacity: 0.8;
}

.auth-card .copyright-text {
    margin-top: 30px;
}