@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-primary: #f8f9fa; /* Soft UI Light background */
    --bg-secondary: #ffffff; /* White cards */
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #344767; /* Soft UI Navy text */
    --text-secondary: #8392ab; /* Soft UI gray text */
    --accent-primary: #7928ca; /* Soft UI Purple */
    --accent-secondary: #21d4fd; /* Soft UI Info Blue */
    --accent-gradient: linear-gradient(310deg, #2152ff 0%, #21d4fd 100%); /* Blue-cyan Soft UI gradient from screen */
    --accent-gradient-hover: linear-gradient(310deg, #3b66ff 0%, #4ae0ff 100%);
    --accent-pink-gradient: linear-gradient(310deg, #7928ca 0%, #ff007f 100%);
    --success: #82d616; /* Soft UI Green */
    --danger: #ea0606;
    --warning: #fbcf33;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.2s ease;
    --font: 'Outfit', sans-serif;
    --shadow-card: 0 20px 27px 0 rgba(0, 0, 0, 0.05); /* Soft UI Shadow */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font);
    line-height: 1.5;
    min-height: 100vh;
    padding-bottom: 3rem;
}

header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 34px;
    height: 34px;
    background: var(--accent-gradient);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 4px 10px rgba(33, 82, 255, 0.2);
}

.logo-text {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-primary);
}

.container {
    max-width: 1300px;
    margin: 2rem auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

@media (min-width: 992px) {
    .container {
        grid-template-columns: 260px 1fr;
    }
}

/* Sidebar navigation */
.sidebar {
    position: sticky;
    top: 90px;
    height: fit-content;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    list-style: none;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-link:hover {
    background: rgba(0, 0, 0, 0.02);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: var(--shadow-card);
    font-weight: 600;
}

.sidebar-link.active .sidebar-icon {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 4px 10px rgba(33, 82, 255, 0.25);
}

.sidebar-icon {
    width: 30px;
    height: 30px;
    background: #ffffff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    color: var(--text-primary);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: var(--transition);
}

/* Glassmorphism / Soft Cards */
.card {
    background: var(--bg-card);
    border: 1px solid rgba(226, 232, 240, 0.5);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.75rem;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
    margin-bottom: 2rem;
}

.card:hover {
    box-shadow: 0 20px 35px 0 rgba(0, 0, 0, 0.08);
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.card-title span {
    color: var(--text-primary);
}

/* Statistics widgets */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stats-card {
    background: var(--bg-card);
    border: 1px solid rgba(226, 232, 240, 0.5);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-card);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px 0 rgba(0,0,0,0.06);
}

.stats-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.stats-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stats-indicator {
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 0.25rem;
}

.stats-icon-box {
    width: 45px;
    height: 45px;
    background: var(--accent-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(33, 82, 255, 0.25);
}

/* Forms styling */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

input[type="text"],
input[type="url"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: #ffffff;
    border: 1px solid #d2d6da; /* Soft UI input border */
    border-radius: 8px;
    color: #495057;
    font-family: var(--font);
    font-size: 0.875rem;
    transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #2152ff;
    box-shadow: 0 0 0 2px rgba(33, 82, 255, 0.2);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.help-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 4px 7px -1px rgba(0, 0, 0, 0.11), 0 2px 4px -1px rgba(0, 0, 0, 0.07);
}

.btn-primary:hover {
    background: var(--accent-gradient-hover);
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgba(33, 82, 255, 0.25);
}

.btn-secondary {
    background: #ffffff;
    color: var(--text-primary);
    border: 1px solid #d2d6da;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.04);
}

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

.btn-danger {
    background: #ea0606;
    color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04);
}

.btn-danger:hover {
    background: #c30404;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.7rem;
}

/* Endpoint List & Details */
.endpoint-item {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.03);
    transition: var(--transition);
}

.endpoint-item:hover {
    box-shadow: 0 10px 20px 0 rgba(0, 0, 0, 0.05);
    transform: translateX(2px);
}

.endpoint-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.75rem;
}

.endpoint-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 6px;
    text-transform: uppercase;
}

/* Soft UI Badge Styles */
.badge-priority-1 { background: #fee2e2; color: #991b1b; }
.badge-priority-2 { background: #fef3c7; color: #92400e; }
.badge-priority-3 { background: #e0f2fe; color: #075985; }
.badge-priority-4 { background: #f3e8ff; color: #6b21a8; }
.badge-priority-5 { background: #dcfce7; color: #166534; }

.badge-success { background: #dcfce7; color: #166534; }
.badge-failure { background: #fee2e2; color: #991b1b; }

.endpoint-url-box {
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-family: monospace;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    color: #2152ff;
    word-break: break-all;
}

.copy-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.2rem;
    transition: var(--transition);
}

.copy-btn:hover {
    color: var(--text-primary);
}

.endpoint-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    gap: 1rem;
}

/* Log view */
.log-item {
    border-left: 4px solid var(--border-color);
    background: #f8f9fa;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.log-item.success { border-left-color: var(--success); }
.log-item.failure { border-left-color: var(--danger); }

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.log-time {
    color: var(--text-secondary);
}

.log-details {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: #495057;
}

.log-expand-btn {
    background: transparent;
    border: none;
    color: #2152ff;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: var(--font);
}

.log-expand-btn:hover {
    text-decoration: underline;
}

.log-body {
    display: none;
    margin-top: 0.75rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    font-family: monospace;
    font-size: 0.75rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    color: #27272a;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #ffffff;
    border: 1px solid #2152ff;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.85rem;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Emoji Picker styling */
.emoji-picker {
    user-select: none;
}

.emoji-pill {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.15rem;
    transition: var(--transition);
}

.emoji-pill:hover {
    background: #f8f9fa;
    border-color: #2152ff;
}

.emoji-pill.active {
    background: rgba(33, 82, 255, 0.08);
    border-color: #2152ff;
    box-shadow: 0 4px 10px rgba(33, 82, 255, 0.15);
    transform: scale(1.02);
}

.emoji-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    text-transform: capitalize;
}

@media (max-width: 576px) {
    .logo-text {
        display: none;
    }
}

/* Mobile responsive menu toggle & sidebar override */
.mobile-menu-toggle {
    display: none;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    align-items: center;
    justify-content: center;
}

.mobile-menu-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

@media (max-width: 991px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .sidebar {
        display: none; /* Hidden by default in mobile view */
        position: fixed;
        top: 65px;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 999;
        background: rgba(248, 249, 250, 0.98);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        padding: 1.5rem 2rem;
        overflow-y: auto;
    }
    
    .sidebar.show {
        display: block !important;
    }
}
