/* ===== ENHANCED RESPONSIVE IMPROVEMENTS ===== */

/* ===== GLOBAL MOBILE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
  /* Prevent horizontal scroll */
  body {
    overflow-x: hidden;
    width: 100%;
  }
  
  /* Main content padding */
  .content-wrapper {
    padding: 1.5rem 1rem;
  }
  
  /* Profile section */
  .profile-img {
    width: 80px !important;
    height: 80px !important;
    display: block !important;
    margin: 0 auto !important;
  }
  
  /* Ensure profile container is centered */
  .relative.inline-block {
    display: block !important;
    text-align: center !important;
  }
  
  /* Company name responsive */
  .company-name {
    font-size: 1.125rem !important;
    text-align: center;
  }
  
  /* Bio section */
  .bg-card {
    padding: 1rem !important;
  }
  
  .bg-card p {
    font-size: 0.875rem !important;
  }
  
  /* Link cards mobile optimization */
  .link-card {
    padding: 0.875rem 1rem !important;
    flex-direction: row !important;
    align-items: center !important;
    text-align: left !important;
  }
  
  .link-card .bg-opacity-20 {
    width: 2.5rem !important;
    height: 2.5rem !important;
    min-width: 2.5rem;
  }
  
  .link-card .bg-opacity-20 i {
    font-size: 1.125rem !important;
  }
  
  .link-card h3 {
    font-size: 0.9375rem !important;
    margin-bottom: 0.125rem;
  }
  
  .link-card p {
    font-size: 0.75rem !important;
    line-height: 1.4;
  }
  
  /* Social icons */
  .social-icon {
    font-size: 1.125rem;
  }
}

/* ===== EXTRA SMALL MOBILE (max-width: 480px) ===== */
@media (max-width: 480px) {
  .content-wrapper {
    padding: 1rem 0.75rem;
  }
  
  .profile-img {
    width: 70px !important;
    height: 70px !important;
    display: block !important;
    margin: 0 auto !important;
  }
  
  /* Ensure profile container is centered on small screens */
  .relative.inline-block {
    display: block !important;
    text-align: center !important;
  }
  
  .company-name {
    font-size: 1rem !important;
  }
  
  .link-card {
    padding: 0.75rem !important;
  }
  
  .link-card .bg-opacity-20 {
    width: 2.25rem !important;
    height: 2.25rem !important;
    min-width: 2.25rem;
  }
  
  .link-card h3 {
    font-size: 0.875rem !important;
  }
  
  .link-card p {
    font-size: 0.6875rem !important;
  }
}

/* ===== MODAL RESPONSIVE FIXES ===== */

/* Tablet and below */
@media (max-width: 1024px) {
  .modal-content {
    width: 92%;
    max-width: 680px;
  }
}

@media (max-width: 768px) {
  /* Modal full optimization */
  .modal-content {
    width: 96%;
    max-width: 100%;
    border-radius: 1rem;
    margin: 1rem auto;
  }
  
  .modal-header {
    padding: 1.25rem 1rem;
  }
  
  .modal-header h2 {
    font-size: 1.125rem;
    line-height: 1.3;
  }
  
  .modal-body {
    padding: 1rem;
  }
  
  /* Modal link cards */
  .modal-body .link-card {
    padding: 0.875rem !important;
    flex-direction: row !important;
    text-align: left !important;
  }
  
  .modal-body .link-card .bg-opacity-20 {
    width: 2.75rem !important;
    height: 2.75rem !important;
  }
  
  .modal-body .link-card h3 {
    font-size: 0.9375rem !important;
  }
  
  .modal-body .link-card p {
    font-size: 0.8125rem !important;
  }
}

@media (max-width: 480px) {
  .modal-content {
    width: 98%;
    margin: 0.5rem auto;
    border-radius: 0.875rem;
  }
  
  .modal-header {
    padding: 1rem 0.875rem;
  }
  
  .modal-header h2 {
    font-size: 1rem;
  }
  
  .modal-body {
    padding: 0.875rem;
  }
  
  .modal-body .link-card {
    padding: 0.75rem !important;
  }
  
  .modal-body .link-card .bg-opacity-20 {
    width: 2.5rem !important;
    height: 2.5rem !important;
  }
  
  .modal-body .link-card h3 {
    font-size: 0.875rem !important;
  }
  
  .modal-body .link-card p {
    font-size: 0.75rem !important;
  }
}

/* ===== FAQ RESPONSIVE IMPROVEMENTS ===== */
@media (max-width: 768px) {
  .faq-container {
    gap: 0.75rem;
  }
  
  .faq-item {
    border-radius: 0.875rem;
  }
  
  .faq-question {
    padding: 0.875rem 1rem;
  }
  
  .faq-question h3 {
    font-size: 0.875rem !important;
    line-height: 1.5;
  }
  
  .faq-question i {
    font-size: 1.125rem;
    min-width: 1.125rem;
  }
  
  .faq-answer p {
    padding: 0.875rem 1rem;
    font-size: 0.8125rem !important;
    line-height: 1.6;
  }
  
  .faq-answer ul,
  .faq-answer ol {
    padding: 0 1rem 0.875rem 2.5rem;
    font-size: 0.8125rem !important;
  }
}

@media (max-width: 480px) {
  .faq-question {
    padding: 0.75rem 0.875rem;
  }
  
  .faq-question h3 {
    font-size: 0.8125rem !important;
  }
  
  .faq-question i {
    font-size: 1rem;
  }
  
  .faq-answer p {
    padding: 0.75rem 0.875rem;
    font-size: 0.75rem !important;
  }
  
  .faq-answer ul,
  .faq-answer ol {
    padding: 0 0.875rem 0.75rem 2rem;
    font-size: 0.75rem !important;
  }
}

/* ===== TIMELINE RESPONSIVE ===== */
@media (max-width: 768px) {
  .timeline-container {
    padding: 1rem 0;
  }
  
  .timeline-item {
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }
  
  .timeline-item:not(:last-child)::after {
    display: none;
  }
  
  .timeline-date {
    flex-direction: row;
    gap: 0.75rem;
    min-width: auto;
  }
  
  .date-badge {
    width: 3rem;
    height: 3rem;
    font-size: 1.125rem;
    border-radius: 0.875rem;
  }
  
  .month {
    font-size: 0.8125rem;
  }
  
  .timeline-content {
    padding: 1rem;
  }
  
  .timeline-content h3 {
    font-size: 0.9375rem !important;
  }
  
  .timeline-content p {
    font-size: 0.8125rem !important;
  }
}

@media (max-width: 480px) {
  .date-badge {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1rem;
  }
  
  .month {
    font-size: 0.75rem;
  }
  
  .timeline-content {
    padding: 0.875rem;
  }
  
  .timeline-content h3 {
    font-size: 0.875rem !important;
  }
  
  .timeline-content p {
    font-size: 0.75rem !important;
  }
}

/* ===== FOLDER STRUCTURE RESPONSIVE ===== */
@media (max-width: 768px) {
  .folder-header {
    padding: 1rem;
  }
  
  .folder-icon {
    width: 2.5rem;
    height: 2.5rem;
  }
  
  .folder-icon i {
    font-size: 1.25rem;
  }
  
  .folder-name {
    font-size: 0.9375rem;
  }
  
  .folder-meta {
    font-size: 0.75rem;
  }
  
  .file-list {
    padding: 0.875rem;
  }
  
  .file-item {
    padding: 0.75rem;
  }
  
  .file-icon {
    width: 2rem;
    height: 2rem;
  }
  
  .file-icon i {
    font-size: 0.875rem;
  }
  
  .file-name {
    font-size: 0.875rem;
  }
  
  .file-meta {
    font-size: 0.6875rem;
  }
  
  .file-action-btn {
    width: 1.875rem;
    height: 1.875rem;
    font-size: 0.8125rem;
  }
}

@media (max-width: 480px) {
  .folder-header {
    padding: 0.875rem;
  }
  
  .folder-icon {
    width: 2.25rem;
    height: 2.25rem;
  }
  
  .folder-icon i {
    font-size: 1.125rem;
  }
  
  .folder-name {
    font-size: 0.875rem;
  }
  
  .folder-meta {
    font-size: 0.6875rem;
  }
  
  .file-item {
    padding: 0.625rem;
  }
  
  .file-icon {
    width: 1.875rem;
    height: 1.875rem;
  }
  
  .file-name {
    font-size: 0.8125rem;
  }
  
  .file-action-btn {
    width: 1.75rem;
    height: 1.75rem;
  }
}

/* ===== BUTTON RESPONSIVE ===== */
@media (max-width: 768px) {
  .btn-primary {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
  }
}

@media (max-width: 480px) {
  .btn-primary {
    padding: 0.625rem 1.25rem;
    font-size: 0.8125rem;
  }
}

/* ===== CONTACT BUTTONS ===== */
@media (max-width: 768px) {
  .contact-btn {
    padding: 0.875rem 1.25rem;
  }
  
  .contact-btn i {
    font-size: 1.25rem;
  }
  
  .contact-btn span {
    font-size: 0.8125rem;
  }
}

@media (max-width: 480px) {
  .contact-btn {
    padding: 0.75rem 1rem;
  }
  
  .contact-btn i {
    font-size: 1.125rem;
  }
  
  .contact-btn span {
    font-size: 0.75rem;
  }
}

/* ===== FOOTER RESPONSIVE ===== */
@media (max-width: 768px) {
  footer {
    padding: 1.5rem 1rem !important;
  }
  
  footer .flex {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  footer .text-sm {
    font-size: 0.8125rem;
  }
}

@media (max-width: 480px) {
  footer {
    padding: 1rem 0.75rem !important;
  }
  
  footer .text-sm {
    font-size: 0.75rem;
  }
}

/* ===== TOAST RESPONSIVE ===== */
@media (max-width: 768px) {
  .copy-toast {
    bottom: 1.5rem;
    right: 1rem;
    left: 1rem;
    padding: 0.875rem 1.25rem;
    font-size: 0.875rem;
  }
}

@media (max-width: 480px) {
  .copy-toast {
    bottom: 1rem;
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
  }
  
  .copy-toast i {
    font-size: 1.125rem;
  }
}

/* ===== LANDSCAPE MODE FIX ===== */
@media (max-height: 500px) and (orientation: landscape) {
  .modal-content {
    max-height: 95vh;
    margin: 0.5rem auto;
  }
  
  .modal-header {
    padding: 0.75rem 1rem;
  }
  
  .modal-header h2 {
    font-size: 0.9375rem;
  }
  
  .modal-body {
    padding: 0.875rem 1rem;
    max-height: calc(95vh - 65px);
  }
}

/* ===== TOUCH IMPROVEMENTS ===== */
@media (hover: none) and (pointer: coarse) {
  /* Increase tap targets for touch devices */
  .close,
  .close-modal,
  .folder-action-btn,
  .file-action-btn {
    min-width: 44px;
    min-height: 44px;
  }
  
  /* Remove hover effects on touch devices */
  .link-card:hover,
  .faq-question:hover,
  .folder-header:hover {
    transform: none;
  }
  
  /* Add active states for touch feedback */
  .link-card:active {
    transform: scale(0.98);
    opacity: 0.9;
  }
  
  .faq-question:active,
  .folder-header:active {
    background: rgba(79, 70, 229, 0.15);
  }
}

/* ===== PREVENT ZOOM ON INPUT FOCUS (iOS) ===== */
@media (max-width: 768px) {
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* ===== SMOOTH SCROLL FOR ALL ===== */
html {
  scroll-behavior: smooth;
}

/* ===== IMPROVE READABILITY ===== */
@media (max-width: 768px) {
  /* Increase line height for better readability on small screens */
  p, li {
    line-height: 1.6;
  }
  
  /* Better text contrast */
  .text-gray-400 {
    color: #9CA3AF !important;
  }
  
  .text-gray-300 {
    color: #D1D5DB !important;
  }
}
