/* Responsive Design */

/* Tablet and Small Desktop */
@media only screen and (max-width: 960px) {
    .container {
        max-width: 100%;
        padding: 0 15px;
    }

    .header .logo {
        height: 140px;
    }

    .header h1 {
        font-size: 1.4em;
    }

    .signup-section {
        padding: 25px 15px 15px;
    }

    #email {
        width: 70%;
        padding-right: 15px;
        padding-left: 15px;
    }

    .social-connect {
        width: 28%;
    }

    .social-links img {
        width: 35px;
        height: 35px;
    }

    .about-content {
        gap: 20px;
    }

    .author-image {
        width: 120px;
        height: 120px;
    }

    .books-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
        max-width: 800px;
    }

    .book-item img {
        width: 100%;
        height: auto;
    }
}

/* Mobile Landscape and Small Tablets */
@media only screen and (max-width: 768px) {
    .header .logo {
        height: 120px;
    }

    .header h1 {
        font-size: 1.2em;
        padding-top: 5px;
    }

    .signup-section {
        padding: 20px 10px;
    }

    #email {
        width: 100%;
        float: none;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.5);
        padding: 0 0 20px 0;
        margin-bottom: 20px;
    }

    .social-connect {
        width: 100%;
        float: none;
        padding-top: 0;
    }

    .form-group {
        flex-direction: column;
    }

    #email-input {
        width: 100%;
        margin-bottom: 10px;
    }

    .submit-btn {
        width: 100%;
        min-width: 100%;
        margin-left: 0;
    }

    .book-previews p {
        text-align: center;
    }

    .preview-books {
        justify-content: center;
    }

    .preview-books img {
        width: 120px;
        height: 192px;
        object-fit: cover;
    }

    .book-downloads {
        gap: 15px;
    }

    .about-content {
        flex-direction: column;
        text-align: center;
    }

    .author-image {
        width: 100px;
        height: 100px;
        margin: 0 auto;
    }

    .books-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
        max-width: 100%;
    }

    .book-item img {
        width: 100%;
        height: auto;
    }
}

/* Mobile Portrait */
@media only screen and (max-width: 680px) {
    .container {
        padding: 0 10px;
    }

    .header {
        padding: 15px 0 25px;
    }

    .header .logo {
        height: 100px;
    }

    .header h1 {
        font-size: 1.1em;
        line-height: 1.3;
    }

    .signup-section {
        margin-top: 15px;
        padding: 15px 8px;
    }

    h2 {
        font-size: 1.1em;
    }

    h3 {
        font-size: 1em;
    }

    .social-connect h3 {
        margin-bottom: 15px;
    }

    .social-links {
        gap: 10px;
    }

    .social-links img {
        width: 30px;
        height: 30px;
    }

    .preview-books img {
        width: 100px;
        height: 160px;
    }

    .success-section {
        padding: 30px 10px;
    }

    .download-label {
        font-size: 12px;
        padding: 6px 12px;
    }

    .browse-section,
    .about-section {
        margin: 30px 0;
    }

    .about-section {
        padding: 20px 15px;
    }

    .books-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        max-width: 100%;
    }

    .book-item img {
        width: 100%;
        height: auto;
    }

    .privacy-notice {
        padding: 10px;
    }

    .privacy-notice p {
        font-size: 11px;
    }
}

/* Very Small Mobile */
@media only screen and (max-width: 480px) {
    .header .logo {
        height: 80px;
    }

    .header h1 {
        font-size: 1em;
    }

    .signup-section {
        padding: 12px 5px;
    }

    .form-group {
        gap: 8px;
    }

    .preview-books {
        flex-wrap: wrap;
    }

    #email-input, .submit-btn {
        padding: 10px 12px;
        font-size: 14px;
    }

    .book-downloads {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .book-download {
        width: 200px;
    }

    .download-label {
        font-size: 11px;
        padding: 5px 10px;
    }

    .about-content {
        gap: 15px;
    }

    .author-image {
        width: 80px;
        height: 80px;
    }

    .about-text p {
        font-size: 14px;
    }

    .books-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        max-width: 100%;
    }

    .book-item img {
        width: 100%;
        height: auto;
    }
}

/* Accessibility: Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .submit-btn:hover,
    .book-download:hover,
    .social-links a:hover,
    .book-item img:hover,
    .preview-books img:hover {
        transform: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .signup-section {
        border: 2px solid #333;
    }
    
    #email-input {
        border-width: 3px;
    }
    
    .submit-btn {
        border: 2px solid #333;
    }
    
    .form-message.success {
        border-width: 2px;
    }
    
    .form-message.error {
        border-width: 2px;
    }
}

/* Print styles */
@media print {
    .social-connect,
    .signup-section,
    .success-section {
        display: none;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    .about-section,
    .browse-section {
        break-inside: avoid;
    }
}