/**
 * Common CSS - The Silicon Tree
 * Shared styles across all pages
 * Updated: December 2024
 */

/*--------------------------------------------------------------
# CSS Variables - Design System
--------------------------------------------------------------*/
:root {
    /* Brand Colors (HSL) */
    --primary: 189, 100%, 71%; /* 73FBD3 */
    --secondary: 184, 83%, 58%; /* 44E5E7 */
    --accent: 202, 100%, 67%; /* 59D2FE */
    --tech-blue: 219, 81%, 66%; /* 4A8FE7 */
    --tech-purple: 235, 100%, 68%; /* 5C7AFF */
    
    /* Base Colors */
    --background: 0, 0%, 100%;
    --foreground: 220, 26%, 14%;
    --muted: 210, 40%, 96.1%;
    --muted-foreground: 215.4, 16.3%, 46.9%;
    --border: 214.3, 31.8%, 91.4%;
    
    /* Card Colors */
    --card: 0, 0%, 100%;
    --card-foreground: 220, 26%, 14%;
    
    /* Typography */
    --font-family: 'Montserrat', system-ui, sans-serif;
    
    /* Spacing */
    --container-padding: 1rem;
    --section-padding: 4rem 0;
    
    /* Border Radius */
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    --heading-color: #37517e;
    --heading-color-rgb: 55, 81, 126;
}

/*--------------------------------------------------------------
# Reset and Base Styles
--------------------------------------------------------------*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    line-height: 1.6;
    padding-top: 60px; /* Account for fixed nav height - desktop */
}

@media (max-width: 768px) {
    body {
        padding-top: 3rem; /* Account for fixed nav height - mobile */
    }
}

/* Hide mobile-saved-count in desktop mode */
@media (min-width: 769px) {
    .mobile-saved-count {
        display: none !important;
    }
}

h1, h2, h3, h4, h5, h6 {
    color: var(--heading-color);
    font-family: var(--heading-font);
  }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/*--------------------------------------------------------------
# Utility Classes
--------------------------------------------------------------*/
.gradient-text {
    background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--secondary)), hsl(var(--accent)));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
}

/*--------------------------------------------------------------
# Button Styles
--------------------------------------------------------------*/
.btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
}

.btn:focus {
    outline: 2px solid hsl(var(--primary));
    outline-offset: 2px;
}

.btn:disabled {
    pointer-events: none;
    opacity: 0.5;
}

/* Button Variants */
.btn-primary {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-color: hsl(var(--primary));
}

.btn-secondary {
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    border-color: hsl(var(--secondary));
}

.btn-secondary:hover {
    background-color: hsl(var(--secondary) / 0.9);
    border-color: hsl(var(--secondary) / 0.9);
}

.btn-outline {
    background-color: transparent;
    color: hsl(var(--foreground));
    border-color: hsl(var(--border));
}

.btn-ghost {
    background-color: transparent;
    border-color: transparent;
}

.btn-ghost:hover {
    background-color: hsl(var(--muted));
}

.btn-accent {
    background: linear-gradient(135deg, hsl(var(--accent)), hsl(var(--primary)));
    color: hsl(var(--foreground));
    border: none;
}

.btn-tech {
    background: linear-gradient(135deg, hsl(var(--tech-blue)), hsl(var(--tech-purple)));
    color: white;
    border: none;
  }

/* Button Sizes */
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-full {
    width: 100%;
}

/* Note: Button Groups removed - not used */

/*--------------------------------------------------------------
# Form Styles
--------------------------------------------------------------*/
/* Note: .form-container removed - not used */

/* Note: .newsletter-form removed - not used */

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: hsl(var(--foreground));
}

.form-group input[type="text"],
.form-group input[type="email"] {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    font-size: 1rem;
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    transition: var(--transition);
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus {
    outline: none;
    border-color: #47e3f1;
    --tw-ring-offset-shadow: 0 0 0 2px hsl(0 0% 100%);
    --tw-ring-shadow: 0 0 0 calc(2px + 2px) #47e3f1;
    box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), 0 0 #0000;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.checkbox-label {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.875rem;
    color: hsl(var(--foreground));
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 1rem;
    width: 1rem;
    background-color: hsl(var(--background));
    border: 1px solid hsl(var(--border));
    border-radius: 0.25rem;
    margin-right: 0.5rem;
    position: relative;
    transition: var(--transition);
}

.checkbox-label:hover .checkmark {
    background-color: hsl(var(--muted));
    border-color: hsl(var(--muted-foreground));
}

.checkbox-label input[type="checkbox"]:checked ~ .checkmark {
    background-color: hsl(var(--primary));
    border-color: hsl(var(--primary));
}

.checkbox-label input[type="checkbox"]:checked ~ .checkmark:after {
    content: "";
    position: absolute;
    display: block;
    left: 0.25rem;
    top: 0.1rem;
    width: 0.25rem;
    height: 0.5rem;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label input[type="checkbox"]:focus ~ .checkmark {
    outline: 2px solid #47e3f1;
    outline-offset: 2px;
}

.newsletter-checkbox {
    justify-content: flex-start;
    margin-top: 0.5rem;
}

/* Note: .newsletter-form .btn styles removed - not used */

/*--------------------------------------------------------------
# Footer Form Styles
--------------------------------------------------------------*/
.footer-form-title {
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-form-description {
    color: #ffffff;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.newsletter-form {
    max-width: none;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.newsletter-form .form-group {
    margin-bottom: 1rem;
}

.newsletter-form .form-group label {
    color: #ffffff;
    font-weight: 500;
}

.newsletter-form input[type="text"],
.newsletter-form input[type="email"] {
    background: #ffffff1a;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: hsl(0 0% 100%);
}

.newsletter-form input[type="text"]:focus,
.newsletter-form input[type="email"]:focus {
    border-color: #47e3f1;
    --tw-ring-offset-shadow: 0 0 0 2px hsl(0 0% 100%);
    --tw-ring-shadow: 0 0 0 calc(2px + 2px) #47e3f1;
    box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), 0 0 #0000;
}

.newsletter-form .checkbox-label {
    color: #ffffff;
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.newsletter-form .checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.newsletter-form .checkmark {
    height: 1rem;
    width: 1rem;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.25rem;
    margin-right: 0.5rem;
    position: relative;
    transition: var(--transition);
}

.newsletter-form .checkbox-label:hover .checkmark {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.newsletter-form .checkbox-label input[type="checkbox"]:checked ~ .checkmark {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.newsletter-form .checkbox-label input[type="checkbox"]:checked ~ .checkmark:after {
    content: "";
    position: absolute;
    display: block;
    left: 0.25rem;
    top: 0.1rem;
    width: 0.25rem;
    height: 0.5rem;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.newsletter-form .checkbox-label input[type="checkbox"]:focus ~ .checkmark {
    outline: 2px solid #47e3f1;
    outline-offset: 2px;
}

.newsletter-form .btn {
    background: #ffffff;
    color: hsl(217 91% 20%);
    border: none;
    font-weight: 600;
    width: 100%;
}

.newsletter-form .btn:hover {
    background: rgba(255, 255, 255, 0.9);
}

/*--------------------------------------------------------------
# Navigation Styles
--------------------------------------------------------------*/
nav {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: hsl(var(--background) / 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid hsl(var(--border));
    width: 100%;
    transition: backdrop-filter 0.3s ease;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4rem;
    margin-right: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.logo {
    font-weight: 700;
    font-size: 1.25rem;
    background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--secondary)));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}

.nav-links {
    gap: 1rem;
    display: flex;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: hsl(var(--foreground) / 0.6);
    font-weight: 500;
    font-size: 1rem;
    transition: var(--transition);
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    display: flex;
}

.nav-link:hover,
.nav-link.active {
    color: hsl(var(--primary));
}

/* Dropdown Navigation Styles */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.dropdown-toggle i:last-child {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.nav-dropdown:hover .dropdown-toggle i:last-child {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: hsl(var(--background));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: none;
    flex-direction: column;
    padding: 0.5rem 0;
    min-width: 12rem;
    margin-top: 0.5rem;
}

.nav-dropdown:hover .dropdown-menu {
    display: flex;
}

/* Add invisible bridge between main menu and sub-menu */
.nav-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 0.5rem;
    background: transparent;
    z-index: 999;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: hsl(var(--foreground) / 0.6);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background: hsl(var(--muted));
    color: hsl(var(--primary));
}

.dropdown-item.active {
    color: hsl(var(--primary));
    background: none;
}

.dropdown-item.active:hover {
    background: hsl(var(--muted));
    color: hsl(var(--primary));
}

.dropdown-item i {
    font-size: 1rem;
    width: 1.25rem;
    text-align: center;
}

.mobile-menu {
    display: none;
}

.mobile-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.menu-icon {
    width: 1.5rem;
    height: 1.5rem;
    stroke: currentColor;
}

/* Note: Responsive navigation styles moved to mobile-common.css */

/*--------------------------------------------------------------
# Page Title Styles
--------------------------------------------------------------*/
.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0.5rem 0 0;
    display: inline-block;
}

.page-description {
    font-size: 1.25rem;
    color: hsl(var(--muted-foreground));
    max-width: 75rem;
}

/*--------------------------------------------------------------
# Section Title Styles
--------------------------------------------------------------*/
.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 3rem;
    position: relative;
    margin: 0;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.view-all-link {
    font-size: 0.875rem;
    color: hsl(var(--primary));
    text-decoration: none;
    white-space: nowrap;
    margin-left: auto;
}

/* Note: Responsive section titles moved to mobile-common.css */

/*--------------------------------------------------------------
# Footer Styles (moved from style.css)
--------------------------------------------------------------*/
.footer-text {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

/* New Footer Styles */
footer {
    background: hsl(217 91% 20%);
    padding: 1.5rem 0;
    margin-top: auto;

}

.footer-content {
    
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

/* Single column footer (index page without form) */
.footer-content:has(.footer-left:only-child) {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
}

.footer-left {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-logo {
    height: 2.5rem;
    width: auto;
}

.footer-brand-name {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-link {
    color: #ffffff;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
        gap: 0.5rem;
    }
    
.footer-link:hover {
    opacity: 0.8;
}

.footer-copyright {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.footer-copyright-text {
    color: #ffffff;
    font-size: 0.875rem;
    margin: 0;
}

.footer-right {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
}

/* Note: Duplicate footer form styles removed */

/* Note: Mobile footer styles moved to mobile-common.css */

/*--------------------------------------------------------------
# Page Header Styles
--------------------------------------------------------------*/
.page-header {
    margin-bottom: 1rem;
    gap: 2rem;
}

.page-header-left {
    align-items: center;
    flex: 1;
}

.page-header-left .page-title {
    margin: 0;
    text-align: left;
    font-size: 2.5rem;
    font-weight: 700;
}

.page-header-right {
    flex-shrink: 0;
}

/* Note: Mobile responsive page header moved to mobile-common.css */

/*--------------------------------------------------------------
# Page Content Styles
--------------------------------------------------------------*/
.page-content {
    background-color: hsl(var(--muted));
}

/*--------------------------------------------------------------
# Notification Styles
--------------------------------------------------------------*/
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    max-width: 400px;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    position: relative;
}

.notification-message {
    flex: 1;
        font-size: 0.875rem;
    line-height: 1.5;
    color: hsl(var(--foreground));
}

.notification-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius);
    color: hsl(var(--muted-foreground));
    transition: var(--transition);
    flex-shrink: 0;
}

.notification-close:hover {
    background: hsl(var(--muted));
    color: hsl(var(--foreground));
}

.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: hsl(var(--muted));
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    overflow: hidden;
}

.notification-progress::before {
        content: '';
        position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: hsl(var(--primary));
    transform: translateX(-100%);
    transition: transform 5s linear;
}

.notification-progress.animate::before {
    transform: translateX(0);
}

/* Success notification */
.notification-success {
    border-left: 4px solid hsl(var(--primary));
}

.notification-success .notification-progress::before {
    background: hsl(var(--primary));
}

/* Error notification */
.notification-error {
    border-left: 4px solid #ef4444;
}

.notification-error .notification-progress::before {
    background: #ef4444;
}

/* Note: Mobile responsive notifications moved to mobile-common.css */

/*--------------------------------------------------------------
# Empty State Styles
--------------------------------------------------------------*/
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  min-height: 300px;
}

.empty-icon {
  font-size: 3rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 1rem;
}

.empty-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 0.5rem;
}

.empty-message {
  font-size: 1rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.5;
  max-width: 400px;
}

/* Error State Styles */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  min-height: 300px;
}

.error-icon {
  font-size: 3rem;
  color: #ef4444;
  margin-bottom: 1rem;
}

.error-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 0.5rem;
}

.error-message {
  font-size: 1rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.5;
  max-width: 400px;
}

/* Show All Card Styles */
.show-all-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.show-all-content {
  text-align: center;
  padding: 2rem;
}

.empty-state-message {
  margin-bottom: 1.5rem;
}

.empty-state-message .empty-icon {
  font-size: 2.5rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 1rem;
}

.empty-state-message .empty-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 0.5rem;
}

.empty-state-message .empty-message {
  font-size: 0.9rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.5;
  margin-bottom: 0;
}

.show-all-link {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 500;
  transition: var(--transition);
}

.show-all-link:hover {
  background: hsl(var(--primary) / 0.9);
  color: hsl(var(--primary-foreground));
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
