/* ==================================================
   COMPANY INFORMATION MODAL STYLES - Cover Page Specific
   ==================================================

   This file contains SPECIFIC styles for the Company Information Modal
   (#infoModal) used on the cover page. It inherits base modal styles from
   ../shared/modals.css and adds Company Info specific functionality.

   IMPORTANT: This file works WITH modals.css, not instead of it!

   Features:
   - Clean company information form
   - Icon-based field layout
   - Company information editing
   - Form validation styling
   - Professional appearance matching brand
   - Design matches Edit Footer Content modal

   Last Updated: [Current Date]
   ================================================== */

/* ==================================================
   1. COMPANY INFO MODAL Z-INDEX (Required for proper layering)
   ================================================== */

#infoModal {
    z-index: 10000 !important;
}

#infoModal .modal-dialog {
    z-index: 10000 !important;
}

#infoModal .modal-content {
    z-index: 10000 !important;
}

/* ==================================================
   2. COMPANY INFO MODAL LAYOUT & STRUCTURE
   ================================================== */

/* Company Info Modal Dialog */
#infoModal .modal-dialog {
    max-width: 600px;
    margin: 80px auto 20px auto !important; /* Same place as New Customer */
    align-items: flex-start !important;
    min-height: auto !important;
}

/* Company Info Modal Content - Shared Styling */
#infoModal .modal-content {
    background: linear-gradient(135deg, #ffffff, #f0f4f8) !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15) !important;
    border: 1px solid #e0e4e8 !important;
    overflow: hidden !important;
}

/* Company Info Modal Header - Classic gray */
#infoModal .modal-header {
    background: #e5e7eb !important;
    color: #374151 !important;
    padding: 10px 16px !important;
    border-bottom: 1px solid #d1d5db !important;
    box-shadow: none !important;
    border-radius: 16px 16px 0 0 !important;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

/* Company Info Modal Header Content */
#infoModal .modal-header .header-content {
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    z-index: 1;
}

/* Company Info Modal Header Icon */
#infoModal .modal-header .header-icon {
    font-size: 20px !important;
    opacity: 0.9;
    color: #4b5563;
}

/* Company Info Modal Header Text */
#infoModal .modal-header .header-text {
    flex: 1;
    position: relative;
}

/* Company Info Modal Title Main */
#infoModal .modal-header .title-main {
    display: block;
    font-size: 16px !important;
    font-weight: 600 !important;
    margin-bottom: 2px !important;
    color: #1f2937;
    letter-spacing: -0.3px;
    line-height: 1.3;
    position: relative;
}

/* Company Info Modal Title Subtitle */
#infoModal .modal-header .title-subtitle {
    display: block;
    font-size: 12px !important;
    font-weight: 500 !important;
    color: #6b7280 !important;
    letter-spacing: 0.2px;
    line-height: 1.35;
    position: relative;
    padding-left: 18px;
    opacity: 1 !important;
}

/* Decorative accent line before subtitle */
#infoModal .modal-header .title-subtitle::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 1.5px;
    background: #9ca3af;
    border-radius: 2px;
}

/* Company Info Modal Close Button */
#infoModal .modal-header .close {
    color: #6b7280 !important;
    opacity: 0.9;
    font-size: 20px;
    font-weight: 400;
    padding: 4px;
    margin: -4px -4px 0 0;
    background: #d1d5db;
    border: 1px solid #9ca3af;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 3;
}

#infoModal .modal-header .close:hover {
    opacity: 1;
    background: #e5e7eb;
    color: #374151 !important;
}

#infoModal .modal-header .close:focus {
    outline: none;
    box-shadow: 0 0 0 2px #9ca3af;
}

/* Company Info Modal Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes lineExpand {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: 16px;
        opacity: 1;
    }
}

@keyframes closeButtonFloat {
    0%, 100% { 
        transform: translateY(0) translateZ(0);
    }
    50% { 
        transform: translateY(-2px) translateZ(5px);
    }
}

/* Company Info Modal Body */
#infoModal .modal-body {
    padding: 15px !important;
    background-color: #ffffff !important;
    min-height: auto;
}

/* Company Info Modal Footer - Match Cover Image Manager footer padding */
#infoModal .modal-footer {
    background-color: #f1f5f9 !important;
    padding: 10px 20px !important; /* Match Cover Image Manager: 10px vertical, 20px horizontal */
    border-top: 1px solid #e0e4e8 !important;
    display: flex !important;
    justify-content: flex-end !important;
    gap: 10px !important; /* Match Cover Image Manager footer gap */
    flex-shrink: 0;
}

/* ==================================================
   3. COMPANY INFO EDITOR CONTAINER
   ================================================== */

/* Company Info Editor Container */
.company-info-editor-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: linear-gradient(135deg, #f8faff 0%, #ffffff 100%);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid rgba(102, 126, 234, 0.1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.05);
}

/* Company Info Editor Form Group */
.company-info-editor-container .form-group {
    margin-bottom: 0;
    position: relative;
    background: white;
    border-radius: 8px;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.company-info-editor-container .form-group:hover {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.company-info-editor-container .form-group:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

/* ==================================================
   4. COMPANY INFO FIELD LABELS
   ================================================== */

/* Company Info Field Labels */
.company-info-editor-container label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.company-info-editor-container .form-group:focus-within label {
    color: #667eea;
}

/* Company Info Field Label Icons */
.company-info-editor-container label i {
    color: #667eea;
    width: 16px;
    font-size: 14px;
    flex-shrink: 0;
}

/* ==================================================
   5. COMPANY INFO INPUT FIELDS
   ================================================== */

/* Company Info Input Fields */
.company-info-editor-container .form-control {
    width: 100%;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    color: #374151;
    background: #ffffff;
    transition: all 0.3s ease;
    font-weight: 500;
}

.company-info-editor-container .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
    background: #fafbff;
}

.company-info-editor-container .form-control::placeholder {
    color: #9ca3af;
    font-style: italic;
    font-weight: 400;
}

/* Input Focus Effect */
.company-info-editor-container .form-group::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: all 0.3s ease;
    transform: translateX(-50%);
    border-radius: 1px;
}

.company-info-editor-container .form-group:focus-within::after {
    width: 100%;
}

/* ==================================================
   6. FIELD-SPECIFIC STYLING
   ================================================== */

/* Company Name Field */
.company-info-editor-container .form-group:nth-child(1) {
    border-left: 4px solid #667eea;
}

.company-info-editor-container .form-group:nth-child(1) label i {
    color: #667eea;
}

/* Address Field */
.company-info-editor-container .form-group:nth-child(2) {
    border-left: 4px solid #10b981;
}

.company-info-editor-container .form-group:nth-child(2) label i {
    color: #10b981;
}

/* Phone Field */
.company-info-editor-container .form-group:nth-child(3) {
    border-left: 4px solid #f59e0b;
}

.company-info-editor-container .form-group:nth-child(3) label i {
    color: #f59e0b;
}

/* Email Field */
.company-info-editor-container .form-group:nth-child(4) {
    border-left: 4px solid #8b5cf6;
}

.company-info-editor-container .form-group:nth-child(4) label i {
    color: #8b5cf6;
}

/* Website Field */
.company-info-editor-container .form-group:nth-child(5) {
    border-left: 4px solid #06b6d4;
}

.company-info-editor-container .form-group:nth-child(5) label i {
    color: #06b6d4;
}

/* ==================================================
   7. MODAL FOOTER BUTTONS - CENTRALIZED STYLING
   ================================================== */

/* All button styles are centralized in ../../shared/button-styles.css */
/* This ensures consistent button styling across ALL modals */

/* Disabled state override */
#infoModal .modal-footer .btn:disabled {
    background: #cccccc !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* ==================================================
   8. VALIDATION STATES
   ================================================== */

/* Valid Input State */
.company-info-editor-container .form-control.valid {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.company-info-editor-container .form-group:has(.form-control.valid)::after {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* Invalid Input State */
.company-info-editor-container .form-control.invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.company-info-editor-container .form-group:has(.form-control.invalid)::after {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* Validation Message */
.validation-message {
    font-size: 12px;
    margin-top: 8px;
    padding: 6px 10px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.validation-message.error {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.validation-message.success {
    color: #059669;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.validation-message i {
    width: 14px;
}

/* ==================================================
   9. RESPONSIVE DESIGN
   ================================================== */

/* Tablet responsiveness */
@media (max-width: 768px) {
    #infoModal .modal-header {
        padding: 16px 18px !important;
    }
    
    #infoModal .modal-header .header-icon {
        font-size: 28px !important;
    }
    
    #infoModal .modal-header .title-main {
        font-size: 20px !important;
    }
    
    #infoModal .modal-header .title-subtitle {
        font-size: 13px !important;
        padding-left: 20px;
    }
    
    #infoModal .modal-header .title-subtitle::before {
        width: 12px;
    }
    
    #infoModal .modal-header .close {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    #infoModal .modal-dialog {
        max-width: 95vw;
        margin: 10px;
    }

    #infoModal .modal-body {
        padding: 12px !important;
    }

    .company-info-editor-container {
        padding: 12px;
        gap: 10px;
    }

    .company-info-editor-container .form-group {
        padding: 8px 10px;
    }

    .company-info-editor-container label {
        font-size: 11px;
        gap: 5px;
        margin-bottom: 5px;
    }

    .company-info-editor-container .form-control {
        padding: 7px 10px;
        font-size: 13px;
    }
}

/* Mobile responsiveness */
@media (max-width: 576px) {
    #infoModal .modal-header {
        padding: 20px 22px !important;
    }
    
    #infoModal .modal-header .header-icon {
        font-size: 32px !important;
    }
    
    #infoModal .modal-header .title-main {
        font-size: 22px !important;
    }
    
    #infoModal .modal-header .title-subtitle {
        font-size: 14px !important;
        padding-left: 28px;
    }
    
    #infoModal .modal-header .title-subtitle::before {
        width: 20px;
        height: 2.5px;
    }
    
    #infoModal .modal-header .close {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    #infoModal .modal-dialog {
        max-width: 98vw;
        margin: 5px;
    }

    #infoModal .modal-body {
        padding: 10px !important;
        min-height: auto;
    }

    #infoModal .modal-footer {
        padding: 12px !important;
        flex-direction: column;
        gap: 8px;
    }

    #infoModal .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }

    .company-info-editor-container {
        padding: 10px;
        gap: 10px;
        border-radius: 8px;
    }

    .company-info-editor-container .form-group {
        padding: 8px 10px;
        border-radius: 6px;
    }

    .company-info-editor-container label {
        font-size: 11px;
        gap: 5px;
        margin-bottom: 5px;
    }

    .company-info-editor-container .form-control {
        padding: 7px 10px;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 4px;
    }
}

/* ==================================================
   10. ACCESSIBILITY & FOCUS STATES
   ================================================== */

/* Enhanced focus states for accessibility */
.company-info-editor-container .form-control:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: more) {
    .company-info-editor-container,
    .company-info-editor-container .form-group {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    #infoModal .modal-header .title-main,
    #infoModal .modal-header .title-subtitle {
        animation: none;
    }
    
    #infoModal .modal-header .title-subtitle::before {
        animation: none;
        width: 16px;
        opacity: 1;
    }
    
    #infoModal .modal-header .close {
        animation: none;
    }
    
    .company-info-editor-container .form-group,
    .company-info-editor-container .form-control,
    .company-info-editor-container .form-group::after {
        transition: none;
    }

    .company-info-editor-container .form-group:hover,
    .company-info-editor-container .form-group:focus-within {
        transform: none;
    }
}

/* ==================================================
   11. LOADING STATES
   ================================================== */

/* Loading Overlay */
.company-info-editor-container.loading {
    position: relative;
    pointer-events: none;
}

.company-info-editor-container.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.company-info-editor-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 11;
}

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

/* ==================================================
   12. PRINT STYLES
   ================================================== */

@media print {
    #infoModal {
        display: none !important;
    }
}
