/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap');

/* CallScout Pro Brand Colors & Design System */
:root {
    --color-primary: #2D8ACF;
    --color-primary-hover: #1F78BE;
    --color-primary-light: #5AA9E6;
    --color-navy: #0F172A;
    --color-text: #111827;
    --color-text-secondary: #475467;
    --color-border: #D0D5DD;
    --color-bg-soft: #F8FAFC;
    --color-white: #FFFFFF;
    --color-success: #12B76A;
    --color-warning: #F59E0B;
    --color-error: #EF4444;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.06), 0 4px 10px rgba(16, 24, 40, 0.08);
    --shadow-modal: 0 8px 24px rgba(16, 24, 40, 0.12);
}

* {
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Manrope', 'Inter', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-bg-soft);
    color: var(--color-text);
}

.brand-gradient {
    background: linear-gradient(135deg, #1F78BE 0%, #2D8ACF 55%, #5AA9E6 100%);
}

.hero-gradient {
    background: linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 100%);
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-white);
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    padding: 0.75rem 1.5rem;
    border: none;
    cursor: pointer;
    display: inline-block;
    text-align: center;
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    box-shadow: var(--shadow-card);
}

.btn-secondary {
    background: #EAF4FB;
    color: var(--color-primary-hover);
    border: 1px solid #B9D9F2;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    display: inline-block;
    text-align: center;
}

.btn-secondary:hover {
    background: #D9EDFA;
}

.card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 2rem;
}

.logo-img {
    height: auto;
    width: 200px;
}

.nav-shadow {
    box-shadow: var(--shadow-card);
}

/* Form Styles */
input[type="email"],
input[type="password"],
input[type="text"],
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    transition: all 0.2s;
    color: var(--color-text);
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(45, 138, 207, 0.1);
}

/* Alert Styles */
.alert-success {
    background-color: #D1FAE5;
    border: 1px solid var(--color-success);
    color: #065F46;
}

.alert-error {
    background-color: #FEE2E2;
    border: 1px solid var(--color-error);
    color: #991B1B;
}

.alert-warning {
    background-color: #FEF3C7;
    border: 1px solid var(--color-warning);
    color: #92400E;
}

/* Call Popup Animations */
@keyframes slide-up {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.animate-slide-up {
    animation: slide-up 0.3s ease-out forwards;
}

/* Call Popups Container - Stack multiple popups */
#call_popups_container {
    display: flex;
    flex-direction: column-reverse;
    gap: 1rem;
    pointer-events: none;
}

#call_popups_container > * {
    pointer-events: auto;
}

/* ========================================
   STANDARDIZED BUTTON COMPONENTS
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    box-shadow: 0 4px 12px rgba(45, 138, 207, 0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--color-white);
    color: var(--color-primary);
    border-color: var(--color-border);
}

.btn-secondary:hover:not(:disabled) {
    background: #F8FAFC;
    border-color: var(--color-primary);
}

.btn-success {
    background: var(--color-success);
    color: var(--color-white);
    border-color: var(--color-success);
}

.btn-success:hover:not(:disabled) {
    background: #0F9A5D;
    box-shadow: 0 4px 12px rgba(18, 183, 106, 0.3);
}

.btn-danger {
    background: var(--color-error);
    color: var(--color-white);
    border-color: var(--color-error);
}

.btn-danger:hover:not(:disabled) {
    background: #DC2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-warning {
    background: var(--color-warning);
    color: var(--color-white);
    border-color: var(--color-warning);
}

.btn-warning:hover:not(:disabled) {
    background: #D97706;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
    border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
    background: #F8FAFC;
    color: var(--color-text);
}

/* ========================================
   FORM COMPONENTS
   ======================================== */

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.form-label-required::after {
    content: " *";
    color: var(--color-error);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    transition: all 0.2s;
    color: var(--color-text);
    background: var(--color-white);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(45, 138, 207, 0.1);
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
    background: #F8FAFC;
    color: var(--color-text-secondary);
    cursor: not-allowed;
}

.form-error {
    color: var(--color-error);
    font-size: 0.8125rem;
    margin-top: 0.375rem;
}

.form-help {
    color: var(--color-text-secondary);
    font-size: 0.8125rem;
    margin-top: 0.375rem;
}

.form-input-error {
    border-color: var(--color-error);
}

.form-input-error:focus {
    border-color: var(--color-error);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* ========================================
   CARD COMPONENTS
   ======================================== */

.card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 1.5rem;
}

.card-header {
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
}

.card-body {
    padding: 0;
}

.card-footer {
    border-top: 1px solid var(--color-border);
    padding-top: 1rem;
    margin-top: 1.5rem;
}

/* ========================================
   LOADING STATES
   ======================================== */

.skeleton {
    background: linear-gradient(90deg, #F0F0F0 25%, #E0E0E0 50%, #F0F0F0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    height: 1.5rem;
    width: 60%;
    margin-bottom: 1rem;
}

.skeleton-card {
    height: 8rem;
}

.spinner {
    border: 3px solid #F3F4F6;
    border-top: 3px solid var(--color-primary);
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 1rem;
    height: 1rem;
    border-width: 2px;
}

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

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

/* ========================================
   EMPTY STATES
   ======================================== */

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    color: var(--color-text-secondary);
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.empty-state-description {
    color: var(--color-text-secondary);
    margin-bottom: 1.5rem;
    max-width: 32rem;
    margin-left: auto;
    margin-right: auto;
}

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */

@media (max-width: 768px) {
    .card {
        padding: 1rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }

    .empty-state {
        padding: 2rem 1rem;
    }

    .nav-shadow {
        position: sticky;
        top: 0;
        z-index: 100;
    }
}

/* ========================================
   TOOLTIP
   ======================================== */

.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: var(--color-navy);
    color: var(--color-white);
    text-align: center;
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--color-navy) transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}
