:root {
    --main-rgb: 96, 125, 139;
    --text-primary: #F9FAFB;
    --text-secondary: #9CA3AF;
    --ui-bg: #1F2937;
    --ui-border: #374151;
    --theme-transition: all 0.4s ease;
}


main {
    font-family: 'persol-farsi-font', sans-serif;
    color: var(--text-primary);
    margin: 0;
    overflow: hidden;
    transition: var(--theme-transition);
    direction: rtl;
}

.landing-grid {
    display: grid;
    grid-template-columns: 60% 40%;
    width: 100vw;
    height: 100vh;
}

.visual-side {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 5vw;
}

#interactive-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.action-panel {
    background-color: var(--ui-panel-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid var(--ui-border);
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    opacity: 0;
    transform: translateX(20px);
    animation: slideIn 1s 0.4s ease-out forwards;
}

.text-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    opacity: 0;
    animation: fadeIn 1s 0.2s ease-out forwards;
}

.hrms-title {
    font-size: clamp(4rem, 8vw, 6rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    margin: 0;
    position: relative;
    background: linear-gradient(135deg, var(--main), var(--text-primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 50px rgba(255, 255, 255, 0.1);
    animation: titleGlow 3s ease-in-out infinite alternate;
}

.hrms-title::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    background: radial-gradient(ellipse at center, var(--main) 20%, transparent 70%);
    transform: translate(-50%, -50%);
    z-index: -1;
    opacity: 0.3;
    animation: pulse 4s ease-in-out infinite;
}

.main-heading {
    font-size: clamp(2rem, 3vw, 2.5rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.2;
    position: relative;
    opacity: 0.9;
    transform: translateY(10px);
    animation: fadeInUp 1s 0.6s ease-out forwards;
}

.main-heading::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--main), transparent);
    opacity: 0;
    animation: lineAppear 1s 1s ease-out forwards;
}

/* --- Entry Button --- */
.enter-section a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background-color: var(--main);
    color: white;
    text-decoration: none;
    border-radius: 0.5rem;
    font-size: 1.1rem;
    font-weight: 500;
    transition: var(--theme-transition), transform 0.2s ease;
}

.enter-section a:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px -5px rgba(var(--main-rgb), 0.4);
}

.enter-section i {
    font-size: 1.5rem;
}

/* --- Modules Showcase --- */
.modules-section {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    cursor: help;
}

.modules-section h3 {
    text-align: center;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 1.25rem;
    padding: 0;
    margin: 0;
    list-style: none;
}

.module-item {
    position: relative;
}

.module-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: var(--ui-bg);
    border: 1px solid var(--ui-border);
    border-radius: 0.75rem;
    font-size: 1.5rem;
    color: var(--text-secondary);
    transition: var(--theme-transition), transform 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.module-item:hover .module-icon {
    transform: translateY(-5px);
    color: var(--main);
    border-color: var(--main);
}

/* --- Module Tooltip --- */
.module-tooltip {
    position: absolute;
    bottom: calc(100% + 15px);
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    padding: 1rem;
    background-color: var(--ui-bg);
    border: 1px solid var(--ui-border);
    border-radius: 0.5rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform-origin: bottom center;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    text-align: justify;
    z-index: 10;
}

.module-item:hover .module-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

.module-tooltip h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-weight: 600;
}

.module-tooltip p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* --- Footer Controls (Updated for Precision) --- */
.controls-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.5rem;
    background-color: var(--ui-bg);
    border: 1px solid var(--ui-border);
    border-radius: 999px;
}

/* Base style for all control links for consistent touch targets */
.controls-footer a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--text-secondary);
    text-decoration: none;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.controls-footer a:hover {
    transform: scale(1.15);
    background-color: rgba(255, 255, 255, 0.05);
}

.control-btn i {
    font-size: 1rem;
    line-height: 1;
}

.color-dot {
    background-color: transparent;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border-width: 2px;
    border-style: solid;
    display: block;
    cursor: pointer;
}

.red {
    border-color: var(--red);
}

.blue {
    border-color: var(--blue);
}

.purple {
    border-color: var(--purple);
}

.green {
    border-color: var(--green);
}

.oak {
    border-color: var(--oak);
}

.teal {
    border-color: var(--teal);
}

.maroon {
    border-color: var(--maroon);
}

.grey {
    border-color: var(--grey);
}

.silver {
    border-color: var(--silver);
}

.orange {
    border-color: var(--orange);
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes titleGlow {
    from {
        filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.2));
        transform: scale(1);
    }
    to {
        filter: drop-shadow(0 0 40px rgba(255, 255, 255, 0.4));
        transform: scale(1.02);
    }
}

@keyframes pulse {
    50% {
        opacity: 0.4;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

@keyframes fadeInUp {
    to {
        opacity: 0.9;
        transform: translateY(0);
    }
}

@keyframes lineAppear {
    to {
        opacity: 1;
        width: 60px;
    }
}

@media (max-width: 1200px) {
    .landing-grid {
        grid-template-columns: 1fr 350px;
    }

    .action-panel {
        width: 350px;
        padding: 2rem;
    }
}

@media (max-width: 1024px) {
    .landing-grid {
        grid-template-columns: 1fr;
        grid-template-rows: 60vh auto;
        height: auto;
        min-height: 100vh;
    }

    .visual-side {
        min-height: 60vh;
        align-items: center;
        text-align: center;
        padding: clamp(2rem, 6vw, 4rem);
    }

    .action-panel {
        position: static;
        width: 100%;
        min-height: auto;
        border-left: none;
        border-top: 1px solid var(--ui-border);
        padding: 2.5rem;
    }

    .text-content {
        gap: 0.8rem;
    }

    .hrms-title {
        font-size: clamp(3.5rem, 10vw, 5rem);
    }
}

@media (max-width: 768px) {
    .landing-grid {
        grid-template-rows: 50vh auto;
    }

    .visual-side {
        min-height: 50vh;
        padding: 2rem;
    }

    .action-panel {
        padding: 2rem 1.5rem;
    }

    .module-grid {
        grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
        gap: 1rem;
        max-width: 400px;
        margin: 0 auto;
    }

    .hrms-title {
        font-size: clamp(3rem, 12vw, 4rem);
    }

    .main-heading {
        font-size: clamp(1.5rem, 4vw, 2rem);
    }
}

@media (max-width: 640px) {
    .landing-grid {
        grid-template-rows: 45vh auto;
    }

    .visual-side {
        min-height: 45vh;
        padding: 1.5rem;
    }

    .action-panel {
        padding: 1.5rem;
    }

    .text-content {
        gap: 0.5rem;
    }

    .hrms-title {
        font-size: clamp(2.5rem, 14vw, 3.5rem);
    }

    .main-heading {
        font-size: clamp(1.3rem, 5vw, 1.8rem);
        margin-top: 1rem;
    }

    .main-heading::after {
        width: 40px;
    }

    .modules-section {
        margin: 1.5rem 0;
    }

    .module-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 0.8rem;
        max-width: 320px;
    }

    .module-tooltip {
        width: 240px;
        padding: 0.8rem;
        z-index: 1000;

    }

    .enter-section a {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .visual-side,
    .action-panel {
        padding: 1rem;
    }

    .module-grid {
        grid-template-columns: repeat(5, 1fr);
        max-width: 280px;
    }

    .controls-footer {
        gap: 0.5rem;
        padding: 0.5rem;
        margin-bottom: 10px;
    }
}
