/* Custom CSS for Theocratic Desk Hub */

/* CSS Variables for consistent theming */
:root {
    --primary-blue: #1e4a72;
    --secondary-blue: #2563eb;
    --light-blue: #3b82f6;
    --accent-blue: #60a5fa;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --bg-light: #f8fafc;
    --white: #ffffff;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Base styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--bg-light);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
    opacity: 0.1;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

/* Service Cards */
.service-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.service-card .card-header {
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--white) 100%);
    border-bottom: 2px solid var(--border-color);
    padding: 2rem;
    text-align: center;
}

.service-card .card-body {
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.service-card .btn {
    margin-top: auto;
}

.service-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--secondary-blue) 0%, var(--light-blue) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

.service-icon i {
    font-size: 2rem;
    color: var(--white);
}

.service-card h3 {
    color: var(--primary-blue);
    font-weight: 600;
}

/* Features List */
.features-list {
    list-style: none;
    padding: 0;
}

.feature-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.feature-item:last-child {
    margin-bottom: 0;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--secondary-blue) 0%, var(--light-blue) 100%);
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* How It Works Section */
.how-it-works {
    background: var(--white);
    border-radius: 20px;
    margin: 3rem 0;
    box-shadow: var(--shadow);
}

.step-card {
    padding: 2rem 1rem;
    transition: transform 0.3s ease;
}

.step-card:hover {
    transform: translateY(-3px);
}

.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--secondary-blue) 0%, var(--light-blue) 100%);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1.5rem;
    box-shadow: var(--shadow);
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
}

footer h5 {
    color: var(--white);
    font-weight: 600;
}

footer .text-white-50 {
    opacity: 0.75;
}

footer a:hover {
    opacity: 0.8;
    text-decoration: underline !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 0;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .service-card .card-header,
    .service-card .card-body {
        padding: 1.5rem;
    }
    
    .service-icon {
        width: 60px;
        height: 60px;
    }
    
    .service-icon i {
        font-size: 1.5rem;
    }
    
    .step-card {
        padding: 1.5rem 1rem;
    }
    
    .step-number {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
    
    .btn-lg {
        padding: 0.625rem 1.25rem;
        font-size: 1rem;
    }
    
    .service-card .card-header,
    .service-card .card-body {
        padding: 1rem;
    }
    
    .service-card {
        height: auto;
        min-height: 400px;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .service-card,
    .step-card,
    .btn-primary {
        transition: none;
    }
    
    .service-card:hover,
    .step-card:hover,
    .btn-primary:hover {
        transform: none;
    }
}

/* Focus states for accessibility */
.btn:focus,
.service-card:focus-within {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

/* Loading animation for improved UX */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.service-card {
    animation: fadeInUp 0.6s ease forwards;
}

.service-card:nth-child(2) {
    animation-delay: 0.2s;
}

.service-card:nth-child(3) {
    animation-delay: 0.4s;
}

/* Floating Contact Button */
.floating-contact-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--secondary-blue) 0%, var(--light-blue) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    border: none;
}

.floating-contact-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
}

.floating-contact-btn i {
    font-size: 1.5rem;
    color: var(--white);
}

/* Contact Modal Styling */
.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--white) 100%);
    border-bottom: 2px solid var(--border-color);
    border-radius: 15px 15px 0 0;
}

.modal-title {
    color: var(--primary-blue);
    font-weight: 600;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 2rem;
}

/* Form Styling */
.form-label {
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.form-control, .form-select {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--secondary-blue);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

.text-danger {
    color: #dc3545 !important;
}

/* Mobile Expandable Service Cards */
@media (max-width: 767px) {
    .service-card {
        transition: all 0.3s ease;
        overflow: hidden;
    }
    
    .service-card.collapsed {
        height: auto !important;
        min-height: 70px !important;
        max-height: none !important;
        display: block !important;
        flex-direction: initial !important;
        padding-bottom: 10px !important;
    }
    
    .service-card.collapsed .service-description {
        display: none !important;
    }
    
    .service-card.collapsed .features-list {
        display: none !important;
    }
    
    .service-card.collapsed .btn {
        display: none !important;
    }
    
    .service-card.collapsed .card-body {
        display: none !important;
    }
    
    .service-card.collapsed .card-header {
        padding: 15px 15px 15px 70px !important;
        display: block !important;
        min-height: 70px !important;
        height: auto !important;
        position: relative;
    }
    
    .service-card.collapsed .service-icon {
        position: absolute !important;
        top: 50% !important;
        left: 65px !important;
        transform: translateY(-50%) !important;
        width: 50px !important;
        height: 50px !important;
        margin: 0 !important;
        font-size: 1.5rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .service-card.collapsed .card-header h3 {
        position: absolute !important;
        top: 50% !important;
        left: 125px !important;
        right: 15px !important;
        transform: translateY(-50%) !important;
        margin: 0 !important;
        font-size: 1rem !important;
        font-weight: 600;
        line-height: 1.3;
        padding-left: 0 !important;
        text-align: left !important;
    }
    
    /* Handle line break in mobile collapsed view */
    .service-card.collapsed .card-header h3 br {
        display: none;
    }
    
    .service-card.collapsed::after {
        content: '+';
        position: absolute;
        top: 50%;
        left: 15px;
        transform: translateY(-50%);
        background: rgba(30, 74, 114, 0.9);
        color: white;
        padding: 8px 12px;
        border-radius: 50%;
        font-size: 18px;
        font-weight: bold;
        z-index: 100;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        pointer-events: none;
    }
    
    .service-card.expanded::after {
        content: '−';
        position: absolute;
        top: 20px;
        left: 15px;
        background: rgba(30, 74, 114, 0.9);
        color: white;
        padding: 8px 12px;
        border-radius: 50%;
        font-size: 18px;
        font-weight: bold;
        z-index: 100;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        pointer-events: none;
    }
    
    .service-card {
        position: relative;
    }
    
    /* Mobile spacing fixes within the media query */
    .services-cascade .col-lg-3.col-md-6 {
        margin-bottom: 1rem !important;
    }
    
    .services-cascade .col-lg-3.col-md-6:last-child {
        margin-bottom: 0 !important;
    }
    
    /* Remove any padding/margin that might cause issues */
    .services-cascade .col-lg-3.col-md-6 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    /* Ensure cards themselves don't have extra margin */
    .service-card.collapsed,
    .service-card.expanded {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
    
    .service-card.expanded {
        height: auto !important;
    }
    
    .service-card.expanded .service-description {
        display: block !important;
        animation: fadeIn 0.3s ease;
    }
    
    .service-card.expanded .features-list {
        display: block !important;
        animation: fadeIn 0.3s ease;
    }
    
    .service-card.expanded .btn {
        display: inline-flex !important;
        animation: fadeIn 0.3s ease;
    }
    
    .service-card.expanded .card-body {
        display: block !important;
        padding: 1.5rem !important;
        animation: fadeIn 0.3s ease;
    }
    
    .service-card.expanded .card-header {
        padding: 1.5rem 1.5rem 0 1.5rem !important;
        display: block !important;
        text-align: center;
    }
    
    .service-card.expanded .service-icon {
        margin: 0 auto 0.5rem auto !important;
        font-size: 2rem !important;
        width: 80px !important;
        height: 80px !important;
    }
    
    .service-card.expanded .card-header h3 {
        font-size: 1.25rem !important;
        font-weight: 500;
        margin-bottom: 0 !important;
    }
    
    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
}

/* Desktop card header alignment fix */
@media (min-width: 769px) {
    .service-card .card-header {
        min-height: 200px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}

/* Mobile Responsive for Floating Button */
@media (max-width: 768px) {
    .floating-contact-btn {
        width: 50px;
        height: 50px;
        bottom: 20px;
        left: 20px;
    }
    
    .floating-contact-btn i {
        font-size: 1.25rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    /* Removed cascade effect - using consistent spacing instead */
}
