﻿@tailwind base;
@tailwind components;
@tailwind utilities;

/* ============ Corporate Modern visual tweaks ============ */
:root {
    --primary: #0B3954;
    --accent: #BFD7EA;
    --neutral: #F4F7F9;
    --font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

/* ============ Base ============ */
html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

body {
    @apply bg-white text-gray-800;
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    width: 100%;
    min-height: 100vh;
}

/* ============ Container ============ */
.site-container {
    max-width: 1150px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
    width: 100%;
}

/* ============ Responsive Container ============ */
@media (max-width: 640px) {
    .site-container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

@media (max-width: 480px) {
    .site-container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* ============ Buttons ============ */
.btn-primary {
    @apply inline-block px-5 py-2 rounded-md text-white;
    background-color: var(--primary);
    transition: all 0.3s ease;
}

    .btn-primary:hover {
        opacity: 0.9;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(11, 57, 84, 0.3);
    }

    .btn-primary:active {
        transform: translateY(0);
    }

/* ============ Header ============ */
.header-logo {
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.2px;
}

/* ============ Cards ============ */
.card {
    @apply bg-white border rounded-md shadow-sm p-5;
    transition: all 0.3s ease;
    width: 100%;
}

    .card:hover {
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
        transform: translateY(-2px);
    }

/* ============ Hero ============ */
.hero-overlay {
    background: linear-gradient(180deg, rgba(11, 57, 84, 0.85), rgba(11, 57, 84, 0.6));
}

/* ============ Grid Fixes ============ */
.grid {
    display: grid;
}

/* ============ Images ============ */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============ Maps ============ */
.leaflet-container {
    width: 100% !important;
    height: 100% !important;
}

/* ============ Scrollbar ============ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #c1c7cd;
    border-radius: 3px;
    transition: background 0.3s;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #a0a7ae;
    }

/* ============ Mobile Specific ============ */
@media (max-width: 768px) {
    /* جلوگیری از زوم خودکار در iOS */
    input, select, textarea {
        font-size: 16px !important;
    }

    /* بهبود اسکرول در موبایل */
    .scaffolder-list,
    .company-list {
        -webkit-overflow-scrolling: touch;
    }
}

/* ============ Touch Improvements ============ */
.touch-action-manipulation {
    touch-action: manipulation;
}

/* ============ Text Utilities ============ */
.text-ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============ Hide Scrollbar ============ */
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

    .hide-scrollbar::-webkit-scrollbar {
        display: none;
    }

/* ============ Responsive Tables ============ */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ============ Print Styles ============ */
@media print {
    .no-print {
        display: none !important;
    }
}

/* ============ Links ============ */
a {
    transition: color 0.2s ease;
}

/* ============ Focus States ============ */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ============ Selection ============ */
::selection {
    background: var(--primary);
    color: white;
}

::-moz-selection {
    background: var(--primary);
    color: white;
}
