@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #6558f5;
    --primary-dark: #5142df;
    --primary-light: rgba(101, 88, 245, 0.08);
    --text: #171936;
    --muted: #7d829d;
    --border: #e7e9f3;
    --background: #f5f6fc;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
    font: inherit;
}

a {
    -webkit-tap-highlight-color: transparent;
}

/* ==========================================
   DASHBOARD LAYOUT
   ========================================== */

.dashboard-container {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh;
}

/* ==========================================
   SIDEBAR
   ========================================== */

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    min-height: 500px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 18px;
    overflow-y: auto;
}

.sidebar-brand h2 {
    color: var(--primary);
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -0.7px;
    margin: 0 8px 32px;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 12px 14px;
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    border-radius: 10px;
    transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background-color: var(--primary-light);
    color: var(--primary);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-plan-badge {
    background: #f1f0fe;
    color: var(--primary);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    border: 1px solid #e0dcfe;
}

.btn-logout {
    width: 100%;
    min-height: 40px;
    padding: 10px;
    background-color: #fee2e2;
    color: #dc2626;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-logout:hover {
    background-color: #fecaca;
}

/* ==========================================
   MAIN CONTENT
   ========================================== */

.main-content {
    width: 100%;
    min-width: 0;
    padding: 36px;
    overflow-wrap: anywhere;
}

.top-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 30px;
}

.header-title-area {
    min-width: 0;
}

.header-title-area h1 {
    font-size: clamp(22px, 2vw, 27px);
    line-height: 1.35;
    font-weight: 800;
    letter-spacing: -0.7px;
    color: var(--text);
    margin-bottom: 8px;
}

.header-title-area h1 span {
    color: var(--primary);
}

.header-title-area p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
}

.language-selector {
    flex-shrink: 0;
}

.lang-dropdown {
    min-height: 40px;
    background: #ffffff;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 14px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    outline: none;
    box-shadow: 0 2px 5px rgba(37, 38, 87, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lang-dropdown:hover,
.lang-dropdown:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(101, 88, 245, 0.1);
}

/* ==========================================
   SUBSCRIPTION CARD
   ========================================== */

.plan-status-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f8fe 100%);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 25px;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    box-shadow: 0 4px 15px rgba(37, 38, 87, 0.03);
}

.plan-info {
    min-width: 0;
}

.plan-info .plan-tag {
    display: inline-block;
    background-color: #e0e7ff;
    color: #3730a3;
    font-size: 11px;
    font-weight: 800;
    padding: 5px 10px;
    border-radius: 20px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.plan-info h2 {
    font-size: 18px;
    line-height: 1.5;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 6px;
}

.plan-info p {
    font-size: 13px;
    line-height: 1.7;
    color: var(--muted);
}

.btn-upgrade {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 42px;
    background: var(--primary);
    color: #ffffff;
    text-decoration: none;
    padding: 11px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    transition: background 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-upgrade:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* ==========================================
   TOOL CARDS
   ========================================== */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
}

.card {
    min-width: 0;
    min-height: 190px;
    background: var(--card-bg);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(37, 38, 87, 0.03);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(37, 38, 87, 0.07);
}

.card h3 {
    font-size: 17px;
    line-height: 1.5;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.card p {
    flex: 1;
    width: 100%;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.8;
    margin-bottom: 22px;
}

.card-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: gap 0.2s ease;
}

.card-link:hover {
    gap: 9px;
}

/* ==========================================
   SMALL DESKTOP / TABLET
   ========================================== */

@media (max-width: 1100px) {
    .dashboard-container {
        grid-template-columns: 225px minmax(0, 1fr);
    }

    .sidebar {
        padding: 22px 14px;
    }

    .main-content {
        padding: 28px 24px;
    }

    .cards-grid {
        gap: 16px;
    }

    .card {
        padding: 20px;
    }
}

/* ==========================================
   TABLET / MOBILE NAVIGATION
   ========================================== */

@media (max-width: 800px) {
    .dashboard-container {
        grid-template-columns: minmax(0, 1fr);
    }

    .sidebar {
        position: relative;
        top: auto;
        height: auto;
        min-height: auto;
        padding: 16px 18px 12px;
        border-right: none;
        border-bottom: 1px solid var(--border);
        overflow: visible;
    }

    .sidebar-brand h2 {
        font-size: 23px;
        margin: 0 0 14px;
    }

    .sidebar-menu {
        flex-direction: row;
        gap: 8px;
        overflow-x: auto;
        padding: 0 0 10px;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }

    .sidebar-menu li {
        flex: 0 0 auto;
    }

    .sidebar-menu li a {
        min-height: 40px;
        padding: 10px 12px;
        font-size: 12px;
        white-space: nowrap;
    }

    .sidebar-footer {
        margin-top: 6px;
        padding-top: 12px;
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }

    .user-plan-badge {
        flex: 1;
    }

    .btn-logout {
        width: auto;
        min-width: 90px;
        padding: 10px 14px;
    }

    .main-content {
        padding: 26px 20px;
    }
}

/* ==========================================
   MOBILE
   ========================================== */

@media (max-width: 560px) {
    .main-content {
        padding: 22px 15px 30px;
    }

    .top-header {
        align-items: flex-start;
        gap: 14px;
        margin-bottom: 22px;
    }

    .header-title-area h1 {
        font-size: 22px;
        letter-spacing: -0.5px;
    }

    .header-title-area p {
        font-size: 13px;
    }

    .lang-dropdown {
        min-height: 38px;
        padding: 8px 10px;
    }

    .plan-status-card {
        padding: 20px;
        margin-bottom: 24px;
        border-radius: 15px;
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
    }

    .plan-info h2 {
        font-size: 17px;
    }

    .plan-info p {
        font-size: 12px;
    }

    .btn-upgrade {
        width: 100%;
    }

    .cards-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .card {
        min-height: 165px;
        padding: 21px;
        border-radius: 14px;
    }

    .card h3 {
        font-size: 16px;
    }

    .card p {
        font-size: 13px;
        margin-bottom: 18px;
    }
}

/* ==========================================
   VERY SMALL PHONES
   ========================================== */

@media (max-width: 360px) {
    .sidebar {
        padding: 14px 12px 10px;
    }

    .main-content {
        padding: 18px 12px 25px;
    }

    .top-header {
        flex-wrap: wrap;
    }

    .language-selector {
        align-self: flex-start;
    }

    .header-title-area h1 {
        font-size: 20px;
    }

    .plan-status-card {
        padding: 16px;
    }

    .card {
        padding: 18px;
    }

    .sidebar-footer {
        flex-wrap: wrap;
    }
}

/* ==========================================
   ACCESSIBILITY
   ========================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
/* COMPACT LANGUAGE PANEL */
.language-panel {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 12px;
  color: #64748b;
}

.language-panel select {
  padding: 6px 9px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: #fff;
  color: #1e293b;
  font-size: 12px;
  cursor: pointer;
  outline: none;
}

.language-panel select:focus {
  border-color: #6558f5;
}

@media (max-width: 600px) {
  .language-panel {
    justify-content: flex-end;
    margin-bottom: 10px;
  }
}
