/* ===================================
   COMMON STYLES FOR HEADACHEMD.ORG
   VERSION: 3.7 - MAIL LOGIN SYSTEM: Updated mail button to use protected login system instead of direct MailHog access
   =================================== */

/* CSS Variables */
:root {
    --navbar-font-size: 14px;
    --primary-color: #a5c422;
    --secondary-color: #393939;
    --text-color: #2c3e50;
    --light-text: #666;
    --border-color: #e9ecef;
    --background-light: #f8f9fa;
    --success-color: #28a745;
    --error-color: #dc3545;
}

/* ===================================
   HEADER STYLES
   =================================== */

/* Header styles to prevent wrapping and minimize height */
header {
    height: auto;
    padding: 5px 0;
    min-height: 0;
}

header .col-md-8.text-align-right {
    padding-top: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
}

header span.phone-icon,
header span.email-icon {
    padding: 0;
    margin: 0 8px;
    border: 0;
    line-height: 1;
}

header .email-icon a {
    white-space: nowrap;
}

/* ===================================
   NAVIGATION STYLES
   =================================== */

.navbar-default .navbar-nav > li > a {
    font-size: var(--navbar-font-size) !important;
}

/* ===================================
   BUTTON STYLES
   =================================== */

/* Submit button styling */
.submit-btn {
    background-color: var(--primary-color);
    border: none;
    border-radius: 3px;
    color: #ffffff;
    font-weight: 600;
    height: 50px;
    width: 100%;
    font-size: 16px;
    margin-top: 15px;
    transition: all 0.4s ease-in-out;
}

.submit-btn:hover {
    background-color: var(--secondary-color);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.submit-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Section buttons */
.section-btn {
    background-color: var(--primary-color);
    border: none;
    border-radius: 3px;
    color: #ffffff;
    font-weight: 600;
    padding: 12px 20px;
    font-size: 16px;
    transition: all 0.4s ease-in-out;
    text-decoration: none;
    display: inline-block;
}

.section-btn:hover {
    background-color: var(--secondary-color);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

/* ===================================
   ABOUT SECTION STYLES
   =================================== */

#about img.img-responsive {
    max-width: 100%;
    height: auto;
}

/* Image caption styling */
.image-caption {
    background-color: var(--background-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px 20px;
    margin-top: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
    display: inline-block;
    margin-left: auto;
    margin-right: auto;
}

.image-caption p {
    margin: 0;
    color: #495057;
    font-size: 17.5px;
    line-height: 1.4;
}

.image-caption p:first-child {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 5px;
}

.image-caption p:last-child {
    font-style: italic;
    color: #6c757d;
}

/* ===================================
   CONTACT FORM STYLES
   =================================== */

.contact-section {
    padding: 80px 0;
    background: #f9f9f9;
}

.contact-form {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.contact-form h2 {
    color: var(--text-color);
    margin-bottom: 30px;
    text-align: center;
}

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

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

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(165, 196, 34, 0.1);
}

.contact-info {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    height: 100%;
}

.contact-info h3 {
    color: var(--text-color);
    margin-bottom: 25px;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--background-light);
    border-radius: 8px;
}

.contact-item i {
    font-size: 24px;
    color: var(--primary-color);
    margin-right: 15px;
    width: 30px;
    text-align: center;
}

.contact-item .contact-details h5 {
    margin: 0;
    color: var(--text-color);
    font-weight: 600;
}

.contact-item .contact-details p {
    margin: 5px 0 0 0;
    color: var(--light-text);
}

/* ===================================
   SUCCESS/ERROR MESSAGE STYLES
   =================================== */

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 5px;
    margin-top: 20px;
    display: none;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 5px;
    margin-top: 20px;
    display: none;
}

/* ===================================
   SUCCESS POPUP STYLES
   =================================== */

.success-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    animation: fadeIn 0.3s ease-in-out;
}

.success-popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 40px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.4s ease-out;
}

.success-icon {
    margin-bottom: 20px;
}

.success-icon i {
    font-size: 60px;
    color: var(--success-color);
    animation: bounce 0.6s ease-in-out;
}

.success-popup h3 {
    color: var(--text-color);
    margin-bottom: 15px;
    font-size: 24px;
    font-weight: 600;
}

.success-popup p {
    color: var(--light-text);
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.5;
}

.success-details {
    background-color: var(--background-light);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: left;
}

.success-details p {
    margin-bottom: 10px;
    color: var(--text-color);
    font-weight: 600;
}

.success-details ul {
    margin: 0;
    padding-left: 20px;
    color: var(--light-text);
}

.success-details li {
    margin-bottom: 8px;
    line-height: 1.4;
}

.close-success-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.close-success-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* ===================================
   MODAL STYLES
   =================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 30px;
    border-radius: 5px;
    width: 350px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

.close-modal {
    position: absolute;
    right: 15px;
    top: 15px;
    cursor: pointer;
    font-size: 24px;
    color: var(--light-text);
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-message {
    color: var(--error-color);
    margin-top: 15px;
    text-align: center;
    padding: 10px;
    background-color: #fff5f5;
    border-radius: 4px;
}

/* ===================================
   ADMIN BUTTON STYLES
   =================================== */

.admin-button-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

/* Stats Button Styles */
.stats-button-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
}

.stats-btn {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s ease;
}

.stats-btn:hover {
    background-color: #0056b3;
    text-decoration: none;
    color: white;
}

/* Mail Button Styles */
.mail-button-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

.mail-btn {
    padding: 10px 20px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s ease;
}

.mail-btn:hover {
    background-color: #1e7e34;
    text-decoration: none;
    color: white;
}

.admin-btn {
    padding: 10px 20px;
    background-color: var(--text-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    text-decoration: none;
}

.admin-btn:hover {
    background-color: #1a252f;
}

.admin-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1001;
}

.admin-popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 30px;
    border-radius: 5px;
    width: 350px;
}

.admin-popup-content h2 {
    margin-bottom: 20px;
    text-align: center;
}

.admin-popup-content .form-group {
    margin-bottom: 20px;
}

.admin-popup-content label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.admin-popup-content input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.admin-popup-content .login-btn {
    width: 100%;
    padding: 12px;
    background-color: var(--text-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
}

.close-popup {
    position: absolute;
    right: 15px;
    top: 15px;
    cursor: pointer;
    font-size: 24px;
    color: var(--light-text);
}

/* ===================================
   ANIMATIONS
   =================================== */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* ===================================
   RESPONSIVE STYLES
   =================================== */

/* Mobile Navigation Styles */
@media (max-width: 768px) {
    header {
        display: none;
    }
    
    .navbar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 56px;
    }
    
    .navbar-brand {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 5px 10px;
        margin-top: 0;
        height: auto;
        order: 1;
    }
    
    .navbar-brand img {
        max-height: 35px;
        width: auto;
        margin-bottom: 4px;
    }
    
    .navbar-toggle {
        order: 2;
        margin-left: auto;
        margin-right: 0;
        margin-top: 0;
        margin-bottom: 0;
        padding: 6px 8px;
        min-height: 44px;
        min-width: 44px;
    }
    
    .brand-text {
        display: block;
        font-size: 13px;
        margin-top: 0;
        line-height: 1.2;
        font-weight: normal;
        color: #666;
        margin-left: 0;
        white-space: nowrap;
    }
    
    header {
        padding: 0;
    }
    
    header .container {
        padding: 0 10px;
    }
    
    header .phone-icon,
    header .email-icon {
        font-size: 12px;
        padding: 0 8px;
    }
    
    /* Improved mobile navigation */
    .navbar-default .navbar-nav li a {
        padding: 12px 15px;
        font-size: 16px;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    /* Better mobile form controls */
    .form-control {
        min-height: 44px;
        font-size: 16px;
    }
    
    /* Mobile-friendly buttons */
    .section-btn,
    button[type="submit"] {
        min-height: 44px;
        padding: 12px 20px;
        font-size: 16px;
    }
    
    /* Mobile map improvements */
    #map {
        height: 400px;
    }
    
    /* Mobile modal improvements */
    .modal-content {
        margin: 10px;
        width: calc(100% - 20px);
        max-width: none;
    }
    
    /* Mobile admin button positioning */
    .admin-button-container {
        bottom: 10px;
        right: 10px;
    }
    
    .admin-btn {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
    }
    
    /* Mobile stats button positioning */
    .stats-button-container {
        bottom: 10px;
        left: 10px;
    }
    
    .stats-btn {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
    }
    
    /* Mobile mail button positioning */
    .mail-button-container {
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .mail-btn {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
    }
    
    /* Mobile contact form */
    .contact-form,
    .contact-info {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    /* Mobile success popup */
    .success-popup-content {
        width: 95%;
        padding: 30px 20px;
        margin: 20px;
    }
    
    .success-icon i {
        font-size: 50px;
    }
    
    .success-popup h3 {
        font-size: 20px;
    }
    
    .success-popup p {
        font-size: 14px;
    }
    
    .close-success-btn {
        padding: 10px 25px;
        font-size: 14px;
    }
    
    /* Mobile modal */
    .modal-content {
        width: 90vw;
        padding: 20px;
        margin: 20px;
    }
    
    #trainingPortalModal h2 {
        font-size: 1.4em;
        white-space: normal;
    }
    
    #trainingPortalModal .form-group input {
        font-size: 16px;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .navbar-brand img {
        max-height: 48px;
    }
    
    .brand-text {
        font-size: 9px;
    }
    
    header .phone-icon,
    header .email-icon {
        font-size: 11px;
        padding: 0 4px;
    }
    
    .navbar-default .navbar-nav li a {
        padding: 10px 12px;
        font-size: 15px;
    }
    
    #map {
        height: 300px;
    }
    
    .success-popup-content {
        width: 98%;
        padding: 25px 15px;
    }
    
    .success-icon i {
        font-size: 45px;
    }
    
    .success-popup h3 {
        font-size: 18px;
    }
    
    .success-details {
        padding: 15px;
    }
    
    .modal-content {
        width: 95vw;
        padding: 15px;
        margin: 10px;
    }
    
    #trainingPortalModal h2 {
        font-size: 1.2em;
    }
    
    .close-modal {
        right: 10px;
        top: 10px;
    }
}

/* Desktop Navigation Styles */
@media (min-width: 769px) {
    .navbar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: auto;
    }
    
    .navbar-brand {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 5px 15px;
        gap: 0;
        margin: 0;
        height: auto;
        flex-shrink: 0;
    }
    
    .navbar-brand img {
        height: auto;
        max-height: 40px;
        width: auto;
        margin: 0;
        margin-bottom: 5px;
        flex-shrink: 0;
    }
    
    .brand-text {
        font-size: 13px;
        line-height: 1.2;
        font-weight: normal;
        color: #666;
        white-space: nowrap;
    }
}

/* Touch-friendly improvements for touch devices */
@media (hover: none) and (pointer: coarse) {
    .section-btn:hover,
    .admin-btn:hover {
        transform: none;
    }
    
    .section-btn:active,
    .admin-btn:active {
        transform: scale(0.98);
    }
    
    #trainingPortalModal .login-btn:hover {
        background-color: var(--text-color);
    }
    
    #trainingPortalModal .login-btn:active {
        background-color: #1a252f;
        transform: scale(0.98);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .navbar-default {
        background-color: var(--background-light);
        border-color: #333;
    }
    
    .section-btn,
    .admin-btn {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .section-btn,
    .admin-btn {
        transition: none;
    }
    
    .section-btn:hover,
    .admin-btn:hover {
        transform: none;
    }
}

/* Accessibility Enhancements */
@media (hover: none) and (pointer: coarse) {
    .section-btn:hover,
    .admin-btn:hover {
        transform: none;
    }
    
    .section-btn:active,
    .admin-btn:active {
        transform: scale(0.98);
    }
    
    #trainingPortalModal .login-btn:hover {
        background-color: var(--text-color);
    }
    
    #trainingPortalModal .login-btn:active {
        background-color: #1a252f;
        transform: scale(0.98);
    }
} 