/* Responsive Styles for DomainAtoll.com */

/* Large Desktop (1200px and up) */
@media (min-width: 1200px) {
    .container {
        padding: 0;
    }
}

/* Tablet and Small Desktop (768px to 1199px) */
@media (max-width: 1199px) {
    .container {
        padding: 0 24px;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .section-title {
        font-size: 28px;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-button {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}

/* Mobile Landscape (576px to 767px) */
@media (max-width: 767px) {
    .header-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .logo-text {
        font-size: 24px;
        letter-spacing: -0.5px;
    }
    
    .nav {
        gap: 20px;
    }
    
    .hero {
        padding: 40px 0;
    }
    
    .hero-title {
        font-size: 28px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .services, .domains, .cta {
        padding: 60px 0;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .section-subtitle {
        font-size: 16px;
    }
    
    .service-card {
        padding: 30px;
    }
    
    .service-title {
        font-size: 20px;
    }
    
    .table-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    
    .search-box {
        max-width: 100%;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    
    .search-input, .search-button {
        width: 100%;
        box-sizing: border-box;
    }
    
    .search-input {
        padding: 14px 16px;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
    
    .search-button {
        padding: 14px 24px;
        font-size: 16px;
        font-weight: 600;
    }
    
    .table-info {
        text-align: center;
    }
    
    /* Mobile card layout for domain table */
    .domains-table {
        min-width: 0;
    }

    .domains-table thead {
        display: none;
    }

    .domains-table tbody tr {
        display: block;
        background: var(--primary-white);
        border: 1px solid var(--gray-200);
        border-radius: 8px;
        margin-bottom: 12px;
        padding: 16px;
        box-shadow: var(--shadow-sm);
    }

    .domains-table tbody tr:hover {
        background: var(--primary-white);
    }

    .domains-table tbody tr.row-transferred {
        opacity: 0.45;
    }

    .domains-table tbody tr.row-transferred:hover {
        opacity: 0.65;
    }

    .domains-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid var(--gray-100);
        font-size: 14px;
    }

    .domains-table td:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .domains-table td:first-child {
        padding-top: 0;
    }

    .domains-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--gray-500);
        flex-shrink: 0;
        margin-right: 16px;
    }

    /* Domain name is the card "header" — make it prominent */
    .domains-table td[data-label="Domain"] {
        border-bottom: 2px solid var(--gray-200);
        padding-bottom: 12px;
        margin-bottom: 4px;
    }

    .domains-table td[data-label="Domain"]::before {
        display: none;
    }

    .domains-table td[data-label="Domain"] .domain-name {
        font-size: 16px;
        font-weight: 700;
        width: 100%;
    }

    /* Contact row takes full width */
    .domains-table td[data-label="Contact"] {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding-top: 12px;
    }

    .domains-table td[data-label="Contact"]::before {
        margin-bottom: 4px;
    }

    .contact-links {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }

    .contact-link {
        padding: 8px 12px;
        font-size: 13px;
    }

    .status-badge {
        padding: 4px 8px;
    }

    .price-change {
        font-size: 13px;
    }

    /* Loading and empty states as cards too */
    .domains-table tbody tr.table-loading,
    .domains-table tbody tr.no-results {
        text-align: center;
    }

    .domains-table tbody tr.table-loading td,
    .domains-table tbody tr.no-results td {
        display: block;
        border-bottom: none;
    }

    .domains-table tbody tr.table-loading td::before,
    .domains-table tbody tr.no-results td::before {
        display: none;
    }

    .cta-title {
        font-size: 24px;
    }
    
    .cta-text {
        font-size: 16px;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 24px;
    }
    
    .footer-links {
        justify-content: center;
    }
}

/* Mobile Portrait (up to 575px) */
@media (max-width: 575px) {
    .container {
        padding: 0 16px;
    }
    
    .logo-text {
        font-size: 22px;
    }
    
    .tagline {
        font-size: 12px;
    }
    
    .nav {
        gap: 16px;
    }
    
    .nav-link {
        font-size: 14px;
    }
    
    .hero-title {
        font-size: 24px;
    }
    
    .hero-subtitle {
        font-size: 14px;
    }
    
    .services, .domains, .cta {
        padding: 40px 0;
    }
    
    .section-title {
        font-size: 22px;
    }
    
    .section-subtitle {
        font-size: 14px;
    }
    
    .service-card {
        padding: 24px;
    }
    
    .service-title {
        font-size: 18px;
        margin-bottom: 20px;
    }
    
    .service-list li {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .pagination {
        gap: 4px;
    }
    
    .pagination-button {
        padding: 6px 12px;
        font-size: 12px;
        min-width: 32px;
    }
    
    .cta-title {
        font-size: 22px;
    }
    
    .cta-text {
        font-size: 14px;
    }
    
    .cta-button {
        padding: 14px 24px;
        font-size: 14px;
    }
    
    .footer-copyright p {
        font-size: 12px;
    }
    
    .footer-disclaimer {
        font-size: 11px;
    }
    
    .footer-link {
        font-size: 12px;
    }
}

/* Very Small Mobile (up to 375px) */
@media (max-width: 375px) {
    .logo-text {
        font-size: 20px;
    }
    
    .hero-title {
        font-size: 22px;
    }
    
    .section-title {
        font-size: 20px;
    }
    
    .service-card {
        padding: 20px;
    }
    
    /* Improved search box for very small screens */
    .search-input {
        padding: 12px 14px;
        font-size: 15px;
    }
    
    .search-button {
        padding: 12px 20px;
        font-size: 15px;
    }
    
    .cta-button {
        padding: 12px 20px;
        font-size: 13px;
    }
    
    .pagination-button {
        padding: 4px 8px;
        font-size: 11px;
        min-width: 28px;
    }
}

/* Print Styles */
@media print {
    .header, .nav, .search-box, .pagination, .cta, .footer-links {
        display: none;
    }
    
    body {
        background-color: white;
        color: black;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    .domains-table {
        border: 1px solid #000;
    }
    
    .domains-table th,
    .domains-table td {
        border: 1px solid #000;
        color: #000;
    }
    
    .contact-link {
        color: #000;
        text-decoration: underline;
    }

    .price-up,
    .price-down,
    .price-stable {
        color: #000;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --primary-black: #000000;
        --primary-white: #ffffff;
        --gray-200: #000000;
        --gray-300: #000000;
    }
    
    .domains-table {
        border: 2px solid #000;
    }
    
    .domains-table th,
    .domains-table td {
        border: 1px solid #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .service-card:hover,
    .contact-link:hover,
    .cta-button:hover,
    .pagination-button:hover {
        transform: none;
    }
}

/* Dark Mode Support (optional) */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-black: #ffffff;
        --primary-white: #000000;
        --gray-50: #171717;
        --gray-100: #262626;
        --gray-200: #404040;
        --gray-300: #525252;
        --gray-400: #737373;
        --gray-500: #a3a3a3;
        --gray-600: #d4d4d4;
        --gray-700: #e5e5e5;
        --gray-800: #f5f5f5;
        --gray-900: #fafafa;
    }
    
    .service-card {
        background-color: var(--gray-100);
    }
    
    .status-negotiable {
        background-color: #14532d;
        color: #bbf7d0;
        border-color: #166534;
    }
    
    .status-non-negotiable {
        background-color: #7f1d1d;
        color: #fecaca;
        border-color: #991b1b;
    }
    
    .status-waiting {
        background-color: #78350f;
        color: #fde68a;
        border-color: #92400e;
    }
    
    .status-transferred {
        background-color: #1e3a8a;
        color: #bfdbfe;
        border-color: #1e40af;
    }
    
    .contact-link {
        background-color: var(--gray-700);
        color: var(--gray-100);
        border-color: var(--gray-600);
    }
    
    .contact-link:hover {
        background-color: var(--gray-600);
    }

    .price-up {
        color: #4ade80;
    }

    .price-down {
        color: #f87171;
    }

    .price-stable {
        color: var(--gray-500);
    }

    .market-disclaimer {
        color: var(--gray-500);
    }

    .table-spinner {
        border-color: var(--gray-200);
        border-top-color: var(--primary-black);
    }
}