/* Clarify App - Responsive CSS */
/* Mobile-first responsive design with breakpoints */

/* Base styles are mobile-first (320px+) */

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
  .container {
    max-width: 540px;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .hero p {
    font-size: 1.125rem;
  }
  
  .floating-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
  .container {
    max-width: 720px;
  }
  
  /* Navigation */
  .nav-toggle {
    display: none;
  }
  
  .nav-menu {
    position: static;
    flex-direction: row;
    background: none;
    box-shadow: none;
    padding: 0;
    transform: none;
    opacity: 1;
    visibility: visible;
    width: auto;
    height: auto;
  }
  
  .nav-item {
    margin: 0;
  }
  
  .nav-link {
    padding: var(--spacing-2) var(--spacing-4);
    border-radius: var(--radius-lg);
  }
  
  /* Hero Section */
  .hero {
    padding: var(--spacing-20) 0;
  }
  
  .hero h1 {
    font-size: 3rem;
  }
  
  .hero p {
    font-size: 1.25rem;
    max-width: 600px;
  }
  
  .floating-cards {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-8);
  }
  
  /* Dashboard */
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-8);
  }
  
  /* Forms */
  .form-row {
    display: flex;
    gap: var(--spacing-4);
  }
  
  .form-row .form-group {
    flex: 1;
  }
  
  /* Modal */
  .modal-content {
    max-width: 600px;
  }
  
  /* Cards */
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Buttons */
  .btn-group {
    display: flex;
    gap: var(--spacing-3);
  }
  
  .btn-group .btn {
    flex: 1;
  }
  
  /* Tabs */
  .tab-list {
    justify-content: flex-start;
  }
  
  .tab-item {
    min-width: auto;
  }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
  .container {
    max-width: 960px;
  }
  
  /* Hero Section */
  .hero h1 {
    font-size: 3.5rem;
  }
  
  .floating-cards {
    grid-template-columns: repeat(4, 1fr);
  }
  
  /* Dashboard */
  .dashboard-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  /* Sidebar Layout */
  .app-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
  }
  
  .sidebar {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: var(--spacing-6);
  }
  
  .main-content {
    padding: var(--spacing-6);
  }
  
  /* Cards */
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  /* Modal */
  .modal-content {
    max-width: 800px;
  }
  
  /* Notes Layout */
  .notes-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: var(--spacing-6);
    height: calc(100vh - 120px);
  }
  
  .notes-sidebar {
    background: var(--bg-secondary);
    border-radius: var(--radius-2xl);
    padding: var(--spacing-6);
    overflow-y: auto;
  }
  
  .notes-editor {
    background: var(--bg-primary);
    border-radius: var(--radius-2xl);
    padding: var(--spacing-6);
    overflow-y: auto;
  }
  
  /* Tasks Kanban */
  .kanban-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-6);
    height: calc(100vh - 200px);
  }
  
  .kanban-column {
    background: var(--bg-secondary);
    border-radius: var(--radius-2xl);
    padding: var(--spacing-6);
    overflow-y: auto;
  }
  
  /* Ideas Mind Map */
  .mind-map-container {
    height: calc(100vh - 200px);
    background: var(--bg-secondary);
    border-radius: var(--radius-2xl);
    position: relative;
    overflow: hidden;
  }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
  .container {
    max-width: 1140px;
  }
  
  /* Hero Section */
  .hero h1 {
    font-size: 4rem;
  }
  
  /* Dashboard */
  .dashboard-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  /* Cards */
  .card-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  /* Sidebar Layout */
  .app-layout {
    grid-template-columns: 320px 1fr;
  }
  
  /* Notes Layout */
  .notes-layout {
    grid-template-columns: 350px 1fr;
  }
  
  /* Tasks Kanban */
  .kanban-board {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Extra extra large devices (1400px and up) */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
  
  /* Dashboard */
  .dashboard-grid {
    grid-template-columns: repeat(5, 1fr);
  }
  
  /* Cards */
  .card-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* Mobile-specific styles */
@media (max-width: 767px) {
  /* Navigation */
  .navbar {
    padding: var(--spacing-4) 0;
  }
  
  .nav-brand {
    font-size: 1.25rem;
  }
  
  .nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-2);
  }
  
  .nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all var(--transition-fast);
  }
  
  .nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  
  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  
  .nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }
  
  .nav-menu {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-6);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    z-index: var(--z-dropdown);
  }
  
  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .nav-item {
    margin-bottom: var(--spacing-4);
  }
  
  .nav-link {
    display: block;
    padding: var(--spacing-3) var(--spacing-4);
    border-radius: var(--radius-lg);
    text-align: center;
  }
  
  /* Hero Section */
  .hero {
    padding: var(--spacing-16) 0 var(--spacing-12);
    text-align: center;
  }
  
  .hero h1 {
    font-size: 2rem;
    margin-bottom: var(--spacing-4);
  }
  
  .hero p {
    font-size: 1rem;
    margin-bottom: var(--spacing-8);
  }
  
  .floating-cards {
    grid-template-columns: 1fr;
    gap: var(--spacing-6);
  }
  
  /* Dashboard */
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-6);
  }
  
  /* Forms */
  .form-row {
    flex-direction: column;
  }
  
  /* Buttons */
  .btn-group {
    flex-direction: column;
  }
  
  .btn-group .btn {
    width: 100%;
  }
  
  /* Modal */
  .modal-content {
    width: 95%;
    margin: var(--spacing-4);
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding: var(--spacing-4);
  }
  
  /* Cards */
  .card-grid {
    grid-template-columns: 1fr;
  }
  
  .card-header,
  .card-body,
  .card-footer {
    padding: var(--spacing-4);
  }
  
  /* Tabs */
  .tab-list {
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .tab-list::-webkit-scrollbar {
    display: none;
  }
  
  .tab-item {
    min-width: 120px;
    text-align: center;
  }
  
  /* Search */
  .search-input {
    margin-bottom: var(--spacing-4);
  }
  
  /* Spacing adjustments */
  .section {
    padding: var(--spacing-12) 0;
  }
  
  .container {
    padding: 0 var(--spacing-4);
  }
  
  /* Touch targets */
  .btn,
  .form-input,
  .form-select,
  .nav-link {
    min-height: 44px;
  }
  
  /* Typography */
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.75rem;
  }
  
  h3 {
    font-size: 1.5rem;
  }
  
  /* Hide desktop-only elements */
  .desktop-only {
    display: none !important;
  }
}

/* Tablet-specific styles */
@media (min-width: 768px) and (max-width: 991px) {
  /* Hide mobile-only elements */
  .mobile-only {
    display: none !important;
  }
  
  /* Tablet-specific adjustments */
  .floating-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop-specific styles */
@media (min-width: 992px) {
  /* Hide mobile and tablet-only elements */
  .mobile-only,
  .tablet-only {
    display: none !important;
  }
}

/* Print styles */
@media print {
  * {
    background: white !important;
    color: black !important;
    box-shadow: none !important;
  }
  
  .navbar,
  .nav-menu,
  .btn,
  .modal,
  .floating-cards {
    display: none !important;
  }
  
  .container {
    max-width: none;
    padding: 0;
  }
  
  .card {
    border: 1px solid #ccc;
    break-inside: avoid;
    margin-bottom: 1rem;
  }
  
  h1, h2, h3, h4, h5, h6 {
    break-after: avoid;
  }
  
  p, li {
    orphans: 3;
    widows: 3;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  :root {
    --border-color: #000;
    --text-primary: #000;
    --text-secondary: #333;
    --bg-primary: #fff;
    --bg-secondary: #f5f5f5;
  }
  
  .btn {
    border: 2px solid currentColor;
  }
  
  .card {
    border: 2px solid var(--border-color);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .floating-card {
    animation: none;
  }
}

/* Focus visible for keyboard navigation */
@media (prefers-reduced-motion: no-preference) {
  :focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
  }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 500px) {
  .hero {
    padding: var(--spacing-8) 0;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .modal-content {
    max-height: 80vh;
  }
}

/* Utility classes for responsive design */
.d-none {
  display: none !important;
}

.d-block {
  display: block !important;
}

.d-flex {
  display: flex !important;
}

.d-grid {
  display: grid !important;
}

/* Responsive display utilities */
@media (max-width: 575px) {
  .d-sm-none { display: none !important; }
  .d-sm-block { display: block !important; }
  .d-sm-flex { display: flex !important; }
  .d-sm-grid { display: grid !important; }
}

@media (min-width: 576px) {
  .d-sm-none { display: none !important; }
  .d-sm-block { display: block !important; }
  .d-sm-flex { display: flex !important; }
  .d-sm-grid { display: grid !important; }
}

@media (min-width: 768px) {
  .d-md-none { display: none !important; }
  .d-md-block { display: block !important; }
  .d-md-flex { display: flex !important; }
  .d-md-grid { display: grid !important; }
}

@media (min-width: 992px) {
  .d-lg-none { display: none !important; }
  .d-lg-block { display: block !important; }
  .d-lg-flex { display: flex !important; }
  .d-lg-grid { display: grid !important; }
}

@media (min-width: 1200px) {
  .d-xl-none { display: none !important; }
  .d-xl-block { display: block !important; }
  .d-xl-flex { display: flex !important; }
  .d-xl-grid { display: grid !important; }
}