/* Social Bones - Unified Styles */
/* Main color: #8139ce */

:root {
    --primary-color: #8139ce;
    --primary-light: #9d5bd4;
    --primary-dark: #6529a8;
    --secondary-color: #f8f9fa;
    --accent-color: #28a745;
    --warning-color: #ffc107;
    --error-color: #dc3545;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border-color: #e0e0e0;
    --border-radius: 8px;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
    --page-banner-height: 140px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: var(--text-primary);
    line-height: 1.6;
}

/* Override Bootstrap primary button color */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Custom primary text */
.text-primary-custom {
    color: var(--primary-color) !important;
}

/* Unified banner for all pages */
.page-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-bottom: 3px solid var(--primary-color);
    box-shadow: 0 4px 20px rgba(129, 57, 206, 0.15);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 40px;
}

.page-banner-content {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 0 20px;
}

.page-banner h1 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.page-banner .page-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 0;
}

/* Page wrapper with banner */
.page-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    padding-top: calc(var(--page-banner-height) + 20px); /* Space for fixed banner */
}

.page-wrapper.no-banner {
    padding-top: 20px; /* No banner version */
}

/* Page header (for inline headers, not fixed) */
.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
}

.page-header h1 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Custom card styles */
.card-custom {
    background: white;
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 1.5rem;
}

.card-custom:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.card-header-custom {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem;
}

.card-header-custom h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.card-body-custom {
    padding: 1.5rem;
}

/* Status indicators */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-warning {
    background: #fff3e0;
    color: #f57c00;
}

.status-error {
    background: #ffebee;
    color: #c62828;
}

/* Alert boxes */
.alert-custom {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success-custom {
    background-color: rgba(40, 167, 69, 0.1);
    border-left-color: var(--accent-color);
    color: #155724;
}

.alert-error-custom {
    background-color: rgba(220, 53, 69, 0.1);
    border-left-color: var(--error-color);
    color: #721c24;
}

.alert-warning-custom {
    background-color: #fff7e6;
    border-left-color: #ffb347;
    color: #856404;
}

/* Photo grid specific styles */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
    margin: 2rem 0;
}

.photo-card {
    background: white;
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.photo-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.photo-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.photo-card-body {
    padding: 1rem;
}

.photo-card-body .photo-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.photo-card-body .photo-meta strong {
    color: var(--text-primary);
    font-weight: 600;
}

.photo-keyword {
    display: inline-block;
    background-color: rgba(129, 57, 206, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

/* Form controls */
.form-control-custom {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control-custom:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(129, 57, 206, 0.1);
}

.form-label-custom {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* Loading states */
.loading-spinner {
    text-align: center;
    padding: 3rem;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.loading-dots:after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* Empty states */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-message {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* Pagination */
.pagination-custom {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.pagination-custom .page-info {
    color: var(--text-secondary);
    font-weight: 500;
    margin: 0 1rem;
}

/* Utility classes */
.text-muted-custom {
    color: var(--text-muted) !important;
}

.text-secondary-custom {
    color: var(--text-secondary) !important;
}

.mb-0 { margin-bottom: 0 !important; }
.mt-3 { margin-top: 1rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }

/* Banner responsive styles */
@media (max-width: 768px) {
    :root {
        --page-banner-height: 120px;
    }
    .page-banner {
        padding: 16px 20px;
    }
    .page-wrapper {
        padding: 15px;
        padding-top: calc(var(--page-banner-height) + 20px);
        padding-left: 15px;
        padding-right: 15px;
    }
    .page-banner h1 {
        font-size: 1.5rem;
    }
    .page-banner .page-subtitle {
        font-size: 0.95rem;
    }
}

@media (max-width: 576px) {
    :root {
        --page-banner-height: 110px;
    }
    .page-banner {
        padding: 12px 15px;
    }
    .page-wrapper {
        padding-top: calc(var(--page-banner-height) + 16px);
    }
    .page-banner h1 {
        font-size: 1.25rem;
    }
    .page-banner .page-subtitle {
        font-size: 0.9rem;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .page-wrapper.no-banner {
        padding: 15px;
    }

    .page-header {
        text-align: center;
    }

    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    .photo-card img {
        height: 150px;
    }

    .pagination-custom {
        flex-direction: column;
        gap: 1rem;
    }

    .pagination-custom .btn {
        width: 100%;
        max-width: 200px;
    }
}

/* Animation classes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Vue cloak */
[v-cloak] {
    display: none;
}

/* Help text */
.help-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Status icons */
.status-icon {
    font-size: 1.25rem;
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* Search form styling */
.search-form {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.search-form-row {
    display: flex;
    gap: 1rem;
    align-items: end;
    flex-wrap: wrap;
}

.search-form-group {
    flex: 1;
    min-width: 250px;
}

@media (max-width: 576px) {
    .search-form-row {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form-group {
        min-width: 100%;
    }
}

/* CV form helpers */
.status-note {
    min-height: 1.25rem;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.border-dashed {
    border-style: dashed !important;
}

.sample-text {
    white-space: pre-wrap;
}

/* Status check layout */
.status-container {
    background: linear-gradient(135deg, #8139ce 0%, #a05fcf 100%);
    padding: 30px;
    border-radius: 15px;
    margin: 30px auto;
    max-width: 900px;
    box-shadow: 0 10px 30px rgba(129, 57, 206, 0.3);
}

.status-header {
    color: #ffffff;
    text-align: center;
    margin-bottom: 30px;
}

.status-header h1 {
    margin-bottom: 10px;
}

.status-header code {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
}

.status-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    transition: box-shadow 0.3s ease;
}

.status-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.status-title {
    font-weight: 600;
    color: #333333;
    margin-bottom: 10px;
    font-size: 1rem;
}

.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.status-badge-success {
    background-color: #d4edda;
    color: #155724;
}

.status-badge-error {
    background-color: #f8d7da;
    color: #721c24;
}

.status-badge-checking {
    background-color: #e9d5ff;
    color: #8139ce;
}

.status-info {
    color: #666666;
    font-size: 0.9rem;
    margin-top: 10px;
}

.business-profile-check {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.selection-list {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.selection-item {
    display: flex;
    align-items: center;
    padding: 8px;
    margin-bottom: 5px;
    border-radius: 5px;
    transition: background 0.2s ease;
}

.selection-item:hover {
    background: #e9ecef;
}

.selection-item input[type="checkbox"],
.selection-item input[type="radio"] {
    margin-right: 10px;
    cursor: pointer;
}

.selection-item label {
    cursor: pointer;
    flex-grow: 1;
    margin-bottom: 0;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-content {
    background: #ffffff;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: var(--shadow);
}

.overlay-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

.photo-count {
    font-weight: 600;
    color: var(--primary-color);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Photo page specific styles */
.photo-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-top: 160px; /* Space for fixed search area */
}

/* State Management Styles */
.state-badge {
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.state-switch-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.state-label {
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.state-label-from {
    color: var(--text-secondary);
}

.state-label-to {
    color: var(--accent-color);
}

/* Frosted Glass Effect */
.frosted {
    position: relative;
    overflow: hidden;
}

.frosted-card {
    position: relative;
    opacity: 0.5;  /* 80% transparency for lighter look */
    transition: opacity 0.3s ease;
}

.frosted-card:hover {
    opacity: 0.99;  /* Slightly more visible on hover */
}

/* Subtle overlay for frosted cards */
.frosted-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.4);  /* Lighter overlay */
    backdrop-filter: blur(2px);  /* Less blur for lighter effect */
    -webkit-backdrop-filter: blur(2px);
    z-index: 1;
    pointer-events: none;
    border-radius: var(--border-radius);
}

.frost-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.2);  /* Very light overlay */
    backdrop-filter: blur(2px);  /* Minimal blur */
    -webkit-backdrop-filter: blur(2px);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: not-allowed;
}

.frost-message {
    background: rgba(255, 255, 255, 0.8);  /* Lighter background */
    padding: 0.5rem 1rem;  /* Smaller padding */
    border-radius: 20px;  /* More rounded for softer look */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);  /* Lighter shadow */
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;  /* Lighter text color */
    font-weight: 400;  /* Normal weight */
    font-size: 0.875rem;  /* Smaller text */
}

/* State-specific styling */
.state-onboarding .status-card {
    border-left: 4px solid var(--warning-color);
}

.state-pending .status-card {
    border-left: 4px solid #17a2b8;
}

.state-running .status-card {
    border-left: 4px solid var(--accent-color);
}

.state-deleted {
    opacity: 0.5;
    pointer-events: none;
}

/* Schedule Progress */
.schedule-progress {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
}

/* State Info Banner */
.state-info-banner {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.state-info-banner h5 {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.state-info-banner p {
    margin-bottom: 0;
    opacity: 0.95;
}

.page-banner .state-info-banner {
    margin-bottom: 0;
    width: 100%;
    max-width: 1400px;
}

.page-state-banner {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.page-state-banner .page-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
}

.check-page .page-banner {
    background: none;
    border-bottom: none;
    padding: 0;
    align-items: stretch;
    width: 100%;
}

.check-page .page-banner .state-info-banner {
    border-radius: 0;
    box-shadow: none;
    max-width: none;
    width: 100%;
    padding: 1.5rem 0;
}

.check-page .page-banner h1,
.check-page .page-banner .page-subtitle {
    color: #ffffff;
}

.page-state-banner-inner {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

@media (max-width: 992px) {
    .check-page .page-banner .state-info-banner {
        padding: 1.5rem 0;
    }
    .page-state-banner-inner {
        padding: 0 1.5rem;
    }
}

@media (max-width: 576px) {
    .check-page .page-banner .state-info-banner {
        padding: 1.25rem 0;
    }
    .page-state-banner-inner {
        padding: 0 1.5rem;
    }
}

/* Interactive hint for RUNNING state */
.running-hint {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.running-hint i {
    font-size: 1.25rem;
}

/* Photo search section extends page-banner styles */
.photo-search-section {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    min-height: 140px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-bottom: 3px solid var(--primary-color);
    box-shadow: 0 4px 20px rgba(129, 57, 206, 0.15);
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 0 40px;
}

.photo-search-layout {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.photo-search-form {
    margin: 0;
    width: 100%;
    padding: 0;
}

.photo-search-actions {
    width: 100%;
    display: flex;
    justify-content: flex-start;
}

.photo-search-actions .btn {
    white-space: nowrap;
}

@media (min-width: 992px) {
    .photo-search-actions {
        width: auto;
        justify-content: flex-end;
        align-items: flex-start;
    }
}

.photo-search-form .input-group {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-radius: 50px;
    overflow: hidden;
    background: white;
}

.photo-search-form .form-control {
    border: none;
    padding: 20px 30px;
    font-size: 18px;
    background: transparent;
    box-shadow: none !important;
}

.photo-search-form .form-control:focus {
    outline: none;
}

.photo-search-form .btn {
    border: none;
    padding: 20px 40px;
    font-size: 18px;
    font-weight: 500;
    border-radius: 0;
    background: var(--primary-color);
    color: white;
    transition: all 0.3s ease;
}

.photo-search-form .btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.photo-search-form .btn:disabled {
    opacity: 0.6;
}

.photo-list-section {
    flex: 1;
    overflow-y: auto;
    background-color: #f8f9fa;
    padding: 30px 20px;
}

.photo-list-section .container-fluid {
    max-width: 1400px;
    margin: 0 auto;
}

.photo-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    background: white;
}

.photo-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 66.67%; /* 2:3 aspect ratio (height:width = 2:3) */
    overflow: hidden;
    background-color: #f0f0f0;
}

.photo-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(129, 57, 206, 0.25);
}

/* Photo grid animation */
.photo-item {
    animation: fadeInUp 0.5s ease backwards;
}

.photo-item:nth-child(1) { animation-delay: 0.05s; }
.photo-item:nth-child(2) { animation-delay: 0.1s; }
.photo-item:nth-child(3) { animation-delay: 0.15s; }
.photo-item:nth-child(4) { animation-delay: 0.2s; }
.photo-item:nth-child(5) { animation-delay: 0.25s; }
.photo-item:nth-child(6) { animation-delay: 0.3s; }

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

.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-item:hover .photo-overlay {
    opacity: 1;
}

.photo-overlay-content {
    text-align: center;
    padding: 10px;
}

.photo-keywords {
    color: white;
    font-size: 14px;
    margin-bottom: 10px;
    word-wrap: break-word;
}

.photo-pull-button {
    background-color: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    transition: all 0.3s ease;
    padding: 5px 15px;
    border-radius: 4px;
    font-size: 14px;
}

.photo-pull-button:hover {
    background-color: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

/* Search placeholder animation */
.photo-search-form .form-control::placeholder {
    color: #999;
    transition: opacity 0.3s ease;
}

.photo-search-form .form-control:focus::placeholder {
    opacity: 0.5;
}

/* Photo page responsive */
@media (max-width: 768px) {
    .photo-search-section {
        min-height: 160px;
        padding: 0 20px;
    }
    .photo-container {
        padding-top: 180px;
    }
    .photo-search-form {
        padding: 0 10px;
    }
    .photo-search-form .form-control {
        padding: 15px 20px;
        font-size: 16px;
    }
    .photo-search-form .btn {
        padding: 15px 25px;
        font-size: 16px;
    }
}

@media (max-width: 576px) {
    .photo-search-section {
        min-height: 180px;
        padding: 0 15px;
    }
    .photo-container {
        padding-top: 200px;
    }
    .photo-search-form .form-control {
        padding: 12px 15px;
        font-size: 14px;
    }
    .photo-search-form .btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    .photo-search-form .input-group {
        border-radius: 30px;
    }
}

/* General helpers */
.dashboard-illustration {
    max-width: 320px;
}

.spinner-border-lg {
    width: 3rem;
    height: 3rem;
    border-width: 0.35rem;
}

/* Override Bootstrap spinner color to purple */
.spinner-border {
    border-color: var(--primary-color) !important;
    border-right-color: transparent !important;
}

/* Override Bootstrap primary color to purple */
.bg-primary,
.progress-bar.bg-primary,
.badge.bg-primary {
    background-color: var(--primary-color) !important;
}
