/* Custom styles for BuildrMonitor iOS app website */

/* iOS-style variables */
:root {
    --ios-blue: #007AFF;
    --ios-gray: #8E8E93;
    --ios-background: #F2F2F7;
    --ios-card: #FFFFFF;
    --ios-text: #000000;
    --ios-secondary-text: #6C6C70;
}

/* Base styles */
html {
    scroll-behavior: smooth;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
    background-color: var(--ios-background);
    color: var(--ios-text);
}

/* iOS-style animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Hero section with iOS-style gradient */
.hero-gradient {
    background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
    position: relative;
    overflow: hidden;
}

.hero-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" fill="rgba(255,255,255,0.1)"/></svg>');
    opacity: 0.1;
}

/* iOS-style cards */
.feature-card {
    background: var(--ios-card);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    animation: scaleIn 0.5s ease-out;
}

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

/* iOS-style buttons */
.btn-primary {
    background: var(--ios-blue);
    color: white;
    border-radius: 12px;
    padding: 12px 24px;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2);
}

/* iOS-style form inputs */
.form-input {
    background: var(--ios-card);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 16px;
    transition: all 0.2s ease;
}

.form-input:focus {
    border-color: var(--ios-blue);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
    outline: none;
}

/* iOS-style navigation */
.nav-link {
    @apply text-gray-700 hover:text-blue-600 font-medium transition-colors duration-200 relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--ios-blue);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    @apply text-blue-600 font-semibold;
}

/* iOS-style section headers */
.section-header {
    font-size: 34px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--ios-text);
}

.section-subheader {
    font-size: 17px;
    color: var(--ios-secondary-text);
    margin-bottom: 32px;
}

/* iOS-style image containers */
.screenshot-container {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.screenshot-container:hover {
    transform: scale(1.02);
}

/* iOS-style loading states */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .section-header {
        font-size: 28px;
    }
    
    .feature-card {
        margin-bottom: 16px;
    }
    
    .btn-primary {
        width: 100%;
    }
}

/* iOS-style scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--ios-background);
}

::-webkit-scrollbar-thumb {
    background: var(--ios-gray);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--ios-blue);
}

/* Enhanced Contact Form Styles */
.contact-form-container {
    background: var(--ios-card);
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 15px;
    font-weight: 500;
    color: var(--ios-text);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    background: var(--ios-background);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 16px;
    color: var(--ios-text);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-input:focus {
    border-color: var(--ios-blue);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
    outline: none;
    background: var(--ios-card);
}

.form-input::placeholder {
    color: var(--ios-gray);
}

textarea.form-input {
    min-height: 120px;
    resize: vertical;
}

.form-submit-button {
    background: var(--ios-blue);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.form-submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2);
}

.form-submit-button:active {
    transform: translateY(0);
}

.form-submit-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.form-submit-button .loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

/* Form validation styles */
.form-input.error {
    border-color: #FF3B30;
}

.error-message {
    color: #FF3B30;
    font-size: 13px;
    margin-top: 4px;
    display: none;
}

.form-input.error + .error-message {
    display: block;
}

/* Success message styles */
.form-success-message {
    background: #34C759;
    color: white;
    padding: 16px;
    border-radius: 12px;
    margin-top: 16px;
    display: none;
    animation: slideUp 0.3s ease-out;
}

/* Contact Form Styles */
#contact .max-w-md {
  box-shadow: 0 4px 24px 0 rgba(0,0,0,0.07);
  background: #fff;
}
#contact label {
  font-weight: 500;
}
#contact input,
#contact textarea {
  background: #f9f9f9;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border 0.2s, box-shadow 0.2s;
}
#contact input:focus,
#contact textarea:focus {
  border-color: var(--ios-blue, #2563eb);
  box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}
#contact button[type="submit"] {
  background: var(--ios-blue, #2563eb);
  color: #fff;
  font-weight: 600;
  border: none;
  border-radius: 0.5rem;
  padding: 0.75rem 0;
  cursor: pointer;
  transition: background 0.2s;
}
#contact button[type="submit"]:hover {
  background: #1d4ed8;
}
#contact .text-red-500 {
  display: block;
}
#contact .hidden {
  display: none !important;
}
#contact .text-green-600 {
  font-weight: 500;
}
@media (max-width: 640px) {
  #contact .max-w-md {
    padding: 1.5rem;
  }
}

/* Feature Card UI Enhancements */
.feature-card-ui {
  background: #fff;
  border-radius: 1.25rem;
  box-shadow: 0 4px 24px 0 rgba(0,0,0,0.07);
  padding: 2rem;
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.feature-card-ui:hover {
  box-shadow: 0 8px 32px 0 rgba(37,99,235,0.12);
  transform: translateY(-8px) scale(1.03);
}
.icon-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  border-radius: 9999px;
  margin-bottom: 1rem;
}
@media (max-width: 768px) {
  .feature-card-ui {
    padding: 1.25rem;
  }
}

/* Screenshot Card UI Enhancements */
.screenshot-card {
  background: #fff;
  border-radius: 1.5rem;
  box-shadow: 0 4px 24px 0 rgba(0,0,0,0.07);
  padding: 1.5rem 1rem 2rem 1rem;
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
}
.screenshot-card:hover {
  box-shadow: 0 8px 32px 0 rgba(37,99,235,0.12);
  transform: translateY(-8px) scale(1.03);
}
.iphone-frame {
  position: relative;
  width: 250px;
  height: 500px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.screenshot-img {
  position: absolute;
  top: 24px;
  left: 24px;
  width: 202px;
  height: 452px;
  object-fit: cover;
  border-radius: 32px;
  z-index: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.iphone-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 250px;
  height: 500px;
  z-index: 2;
  pointer-events: none;
}
@media (max-width: 1024px) {
  .iphone-frame {
    width: 180px;
    height: 360px;
  }
  .screenshot-img {
    width: 146px;
    height: 326px;
    top: 17px;
    left: 17px;
    border-radius: 24px;
  }
  .iphone-svg {
    width: 180px;
    height: 360px;
  }
}
@media (max-width: 640px) {
  .screenshot-card {
    padding: 1rem 0.5rem 1.5rem 0.5rem;
  }
  .iphone-frame {
    width: 120px;
    height: 240px;
  }
  .screenshot-img {
    width: 98px;
    height: 218px;
    top: 11px;
    left: 11px;
    border-radius: 14px;
  }
  .iphone-svg {
    width: 120px;
    height: 240px;
  }
}

/* Enhanced Section Title Styles */
.section-title {
  margin-bottom: 3rem;
  animation: fadeIn 0.7s cubic-bezier(0.4,0,0.2,1);
}
.section-header {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ios-text);
  margin-bottom: 0.5rem;
  line-height: 1.1;
}
.section-underline {
  display: block;
  width: 64px;
  height: 6px;
  margin: 0.5rem auto 1.25rem auto;
  border-radius: 3px;
  background: linear-gradient(90deg, #007AFF 0%, #5856D6 100%);
  box-shadow: 0 2px 8px rgba(0,122,255,0.10);
}
.section-subheader {
  color: var(--ios-secondary-text);
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 0;
  margin-top: 0.5rem;
}
@media (max-width: 640px) {
  .section-header {
    font-size: 1.5rem;
  }
  .section-underline {
    width: 40px;
    height: 4px;
  }
  .section-title {
    margin-bottom: 2rem;
  }
  .section-subheader {
    font-size: 1rem;
  }
}

/* Hero Section with Background Image and Overlay */
.hero-bg {
  background: url('screenshots/header.png') center center/cover no-repeat;
  position: relative;
}
.hero-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(120deg, rgba(0, 42, 120, 0.7) 0%, rgba(88, 86, 214, 0.7) 100%);
  z-index: 1;
  pointer-events: none;
}
.hero-title {
  font-size: 4rem;
  font-weight: 900;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: #fff;
  text-shadow: 0 6px 32px rgba(0,0,0,0.25), 0 1px 2px rgba(0,0,0,0.18);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  margin-top: 0;
  animation: fadeIn 1s cubic-bezier(0.4,0,0.2,1);
}
.hero-subtitle {
  color: #e0e7ff;
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 2.5rem;
  margin-top: 0.5rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.12);
  animation: fadeIn 1.2s cubic-bezier(0.4,0,0.2,1);
}
.appstore-btn {
  background: linear-gradient(90deg, #007AFF 0%, #5856D6 100%);
  color: #fff;
  font-weight: 700;
  font-size: 1.25rem;
  box-shadow: 0 4px 24px 0 rgba(0,122,255,0.18);
  border: none;
  border-radius: 1rem;
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
  padding: 1.25rem 2.5rem;
}
.appstore-btn:hover {
  background: linear-gradient(90deg, #2563eb 0%, #7c3aed 100%);
  box-shadow: 0 8px 32px 0 rgba(88,86,214,0.18);
  transform: translateY(-2px) scale(1.03);
}
@media (max-width: 900px) {
  .hero-title {
    font-size: 2.5rem;
  }
  .hero-subtitle {
    font-size: 1.1rem;
  }
}
@media (max-width: 600px) {
  .hero-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }
  .hero-subtitle {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }
}

/* SPA Page Content Styles */
.page-content {
    @apply min-h-screen;
    animation: fadeIn 0.3s ease-in-out;
}

.page-content.hidden {
    display: none;
}

/* Ensure proper spacing for SPA pages */
#app {
    padding-top: 64px; /* Account for fixed navbar */
    display: flex;
    flex-direction: column;
}

/* Smooth transitions for page content */
.page-content {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Loading states for SPA */
.loading-spinner {
    @apply inline-block w-6 h-6 border-2 border-gray-300 border-t-blue-600 rounded-full animate-spin;
}

/* Loading spinner for modals */
.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Ensure modals work properly in SPA */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Navigation styles for authenticated users */
#auth-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#auth-nav a {
    text-decoration: none;
    color: #374151;
    font-weight: 500;
    transition: color 0.2s;
}

#auth-nav a:hover {
    color: #3b82f6;
}

/* User dropdown styles */
#userDropdown {
    @apply transform opacity-0 scale-95 transition-all duration-200;
}

#userDropdown.show {
    @apply opacity-100 scale-100;
}

#userDropdown a,
#userDropdown button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 1rem;
    color: #374151;
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

#userDropdown a:hover,
#userDropdown button:hover {
    background-color: #f3f4f6;
}

#userDropdown button {
    color: #dc2626;
}

/* Ensure proper z-index stacking */
nav {
    z-index: 100;
}

.modal-backdrop {
    z-index: 200;
}

/* SPA Navigation Styles */
.nav-link {
    @apply text-gray-700 hover:text-blue-600 font-medium transition-colors duration-200 relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--ios-blue);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    @apply text-blue-600 font-semibold;
}

/* Page Content Transitions */
.page-content {
    @apply min-h-screen;
    animation: fadeIn 0.3s ease-in-out;
}

.page-content.hidden {
    display: none;
}

/* Loading States */
.loading-content {
    @apply flex items-center justify-center min-h-64;
}

.loading-spinner {
    @apply inline-block w-6 h-6 border-2 border-gray-300 border-t-blue-600 rounded-full animate-spin;
}

/* User Dropdown */
#userDropdown {
    @apply transform opacity-0 scale-95 transition-all duration-200;
}

#userDropdown.show {
    @apply opacity-100 scale-100;
}

/* Notification Animations */
.notification {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Hash Routing Support */
.hash-link {
    @apply cursor-pointer;
}

.hash-link:hover {
    @apply text-blue-600;
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .nav-link {
        @apply text-sm;
    }
    
    #userDropdown {
        @apply right-0 left-auto;
    }
}

/* Dashboard Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
    align-items: center;
}

.action-button {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    transition: background-color 0.2s;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border: none;
    cursor: pointer;
    text-align: center;
}

.action-button.changes {
    background-color: #3b82f6; /* bg-blue-500 */
}
.action-button.changes:hover {
    background-color: #2563eb; /* hover:bg-blue-600 */
}

.action-button.chat {
    background-color: #22c55e; /* bg-green-500 */
}
.action-button.chat:hover {
    background-color: #16a34a; /* hover:bg-green-600 */
}

.action-button.schedule {
    background-color: #f97316; /* bg-orange-500 */
}
.action-button.schedule:hover {
    background-color: #ea580c; /* hover:bg-orange-600 */
}

.edit-button {
    padding: 0.625rem;
    border-radius: 0.5rem;
    background-color: #f3f4f6; /* bg-gray-100 */
    color: #4b5563; /* text-gray-600 */
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
    line-height: 1; /* Ensures icon is centered */
}

.edit-button:hover {
    background-color: #e5e7eb; /* hover:bg-gray-200 */
}

/* Timeline View Styles */
.view-toggle-btn {
    color: #6b7280;
    background: transparent;
}

.view-toggle-btn:hover {
    color: #374151;
    background: rgba(59, 130, 246, 0.1);
}

.view-toggle-btn.active {
    background-color: #ffffff;
    color: #3b82f6; /* blue-500 */
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.timeline-content {
    background-color: #f7fafc;
}

#ganttContainer {
    overflow-x: auto;
}

.gantt-chart {
    display: inline-block;
    min-width: 100%;
    border-left: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.gantt-header-row {
    border-top: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 30;
    background-color: #f8fafc;
}

.gantt-task-row {
    border-top: 1px solid #e2e8f0;
}

.gantt-task-row:hover {
    background-color: #f9fafb;
}

.gantt-header-cell {
    padding: 12px 8px;
    font-weight: 600;
    text-align: center;
    border-right: 1px solid #e2e8f0;
    font-size: 0.875rem;
    white-space: nowrap;
}

.gantt-header-cell.task-header {
    text-align: left;
    position: sticky;
    left: 0;
    z-index: 20;
    background-color: inherit;
}

.gantt-task-info {
    padding: 12px 8px;
    border-right: 1px solid #e2e8f0;
    position: sticky;
    left: 0;
    z-index: 10;
    background-color: #fff;
}

.gantt-task-row:hover .gantt-task-info {
    background-color: #f9fafb;
}

.gantt-task-bar {
    display: flex;
    align-items: center;
    margin: 4px;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    color: white;
    padding: 4px 8px;
    cursor: pointer;
    z-index: 5;
    min-height: 36px;
}

.gantt-task-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
    font-size: 0.875rem;
    z-index: 2;
}

.gantt-progress-overlay {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 1;
    opacity: 0.8;
}

.gantt-today-marker {
    position: relative;
    pointer-events: none;
}

.gantt-today-marker::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 2px;
    background-color: var(--ios-blue);
    z-index: 35;
}

#calendarView .bg-white {
    border: 1px solid #e2e8f0;
}

/* Calendar Styles */
.calendar-day-header {
    text-align: center;
    font-weight: 600;
    padding: 12px 0;
    font-size: 0.875rem;
    color: #4a5568;
}

.calendar-day {
    border-top: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    padding: 8px;
    min-height: 120px;
    position: relative;
    transition: background-color 0.2s;
}

.calendar-day:nth-child(7n) {
    border-right: none;
}

.calendar-day.other-month {
    background-color: #f7fafc;
    color: #a0aec0;
}

.calendar-day.today {
    background-color: #ebf8ff;
    font-weight: bold;
}

.calendar-tasks-container {
    margin-top: 4px;
}

.calendar-task-entry {
    padding: 4px 8px;
    margin-bottom: 4px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-more-tasks {
    font-size: 0.75rem;
    font-weight: 500;
    color: #4a5568;
    margin-top: 4px;
}