* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #A855F7;
    --primary-hover: #9333EA;
    --primary-glow: rgba(168, 85, 247, 0.5);
    --secondary-color: #EC4899;
    --success-color: #10B981;
    --danger-color: #EF4444;
    --background: #0A0A0F;
    --surface: #16161F;
    --surface-hover: #1F1F2E;
    --text: #F3F4F6;
    --text-secondary: #9CA3AF;
    --border: #27273F;
    --accent-purple: #C084FC;
    --accent-pink: #F472B6;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--background);
    color: var(--text);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 20% 50%, rgba(168, 85, 247, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.15) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(50px, -30px) rotate(5deg); }
    66% { transform: translate(-30px, 50px) rotate(-5deg); }
}

/* Logs Styles */
.logs-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.logs-container {
    max-height: 500px;
    overflow-y: auto;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.log-entry {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.log-entry:hover {
    background: var(--surface-hover);
    border-color: var(--primary-color);
    box-shadow: 0 0 15px var(--primary-glow);
}

.log-time {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.log-content {
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}

.log-content strong {
    color: var(--primary-color);
}

.log-footer {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 5px;
    font-style: italic;
}

.logs-container::-webkit-scrollbar {
    width: 8px;
}

.logs-container::-webkit-scrollbar-track {
    background: var(--background);
    border-radius: 10px;
}

.logs-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.logs-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}


body > * {
    position: relative;
    z-index: 1;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: var(--surface);
    padding: 48px;
    border-radius: 24px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                0 0 40px rgba(168, 85, 247, 0.1);
    width: 100%;
    max-width: 420px;
    backdrop-filter: blur(20px);
    animation: fadeInScale 0.6s ease-out;
}

@keyframes fadeInScale {
    0% { 
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    100% { 
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.login-box h1 {
    text-align: center;
    margin-bottom: 10px;
    font-size: 32px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    animation: shimmer 3s ease-in-out infinite;
    background-size: 200% 200%;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.error-message {
    background: rgba(239, 68, 68, 0.2);
    color: #FCA5A5;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    margin-bottom: 20px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--background);
    color: var(--text);
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.15),
                0 0 20px rgba(168, 85, 247, 0.3);
    transform: translateY(-1px);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.15), 0 0 20px rgba(168, 85, 247, 0.3); }
    50% { box-shadow: 0 0 0 6px rgba(168, 85, 247, 0.1), 0 0 30px rgba(168, 85, 247, 0.5); }
}

/* Buttons */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    width: 100%;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(168, 85, 247, 0.6);
    animation: buttonGlow 1.5s ease-in-out infinite;
}

@keyframes buttonGlow {
    0%, 100% { box-shadow: 0 8px 25px rgba(168, 85, 247, 0.6); }
    50% { box-shadow: 0 8px 35px rgba(168, 85, 247, 0.8), 0 0 20px rgba(236, 72, 153, 0.4); }
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-secondary {
    background: var(--surface-hover);
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Navbar */
.navbar {
    background: rgba(22, 22, 31, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 24px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar h1 {
    font-size: 26px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    animation: shimmer 3s ease-in-out infinite;
    background-size: 200% 200%;
}

.navbar .btn {
    width: auto;
    padding: 10px 20px;
}

/* Dashboard */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.header-section h2 {
    font-size: 28px;
}

.header-section .btn {
    width: auto;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 18px;
}

/* Webhooks Grid */
.webhooks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.webhook-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 28px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: cardAppear 0.5s ease-out backwards;
}

.webhook-card:nth-child(1) { animation-delay: 0.1s; }
.webhook-card:nth-child(2) { animation-delay: 0.2s; }
.webhook-card:nth-child(3) { animation-delay: 0.3s; }
.webhook-card:nth-child(4) { animation-delay: 0.4s; }
.webhook-card:nth-child(5) { animation-delay: 0.5s; }
.webhook-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes cardAppear {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.webhook-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.webhook-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.1), transparent);
    transition: left 0.6s ease;
}

.webhook-card:hover::after {
    left: 100%;
}

.webhook-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px rgba(168, 85, 247, 0.3),
                0 0 0 1px rgba(168, 85, 247, 0.4),
                0 0 40px rgba(236, 72, 153, 0.2);
    background: var(--surface-hover);
}

.webhook-card:hover::before {
    opacity: 1;
}

.webhook-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.webhook-header h3 {
    font-size: 20px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    word-break: break-word;
    font-weight: 600;
    background-size: 200% 200%;
    animation: shimmer 3s ease-in-out infinite;
}

.btn-delete {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-left: 10px;
}

.btn-delete:hover {
    opacity: 1;
    transform: scale(1.2) rotate(15deg);
    filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.6));
}

.webhook-info {
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.webhook-info p {
    margin-bottom: 8px;
    font-size: 14px;
}

.webhook-actions {
    display: flex;
    gap: 10px;
}

.webhook-actions .btn {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    transform-origin: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.webhook-actions .btn:hover {
    transform: translateY(-3px) scale(1.05);
}

.webhook-actions .btn:active {
    transform: translateY(-1px) scale(1.02);
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 18px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { 
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to { 
        opacity: 1;
        backdrop-filter: blur(8px);
    }
}

.modal-content {
    background: var(--surface);
    margin: 10% auto;
    padding: 36px;
    border-radius: 24px;
    border: 1px solid var(--border);
    width: 90%;
    max-width: 520px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6),
                0 0 40px rgba(168, 85, 247, 0.2);
    backdrop-filter: blur(20px);
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from { 
        transform: translateY(-50px) scale(0.9); 
        opacity: 0; 
    }
    to { 
        transform: translateY(0) scale(1); 
        opacity: 1; 
    }
}

.close {
    color: var(--text-secondary);
    float: right;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
    transition: all 0.3s ease;
}

.close:hover {
    color: var(--text);
    transform: rotate(90deg) scale(1.1);
}

.modal-content h2 {
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    background-size: 200% 200%;
    animation: shimmer 3s ease-in-out infinite;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.form-actions .btn {
    flex: 1;
}

.modal-message {
    margin-top: 18px;
    padding: 14px 18px;
    border-radius: 12px;
    text-align: center;
    display: none;
}

.modal-message.success {
    background: rgba(16, 185, 129, 0.2);
    color: #6EE7B7;
    border: 1px solid rgba(16, 185, 129, 0.3);
    backdrop-filter: blur(10px);
    display: block;
    animation: successPulse 0.5s ease-out;
}

@keyframes successPulse {
    0% { transform: scale(0.9); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.modal-message.error {
    background: rgba(239, 68, 68, 0.2);
    color: #FCA5A5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    backdrop-filter: blur(10px);
    display: block;
    animation: shake 0.5s ease-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Responsive */
@media (max-width: 768px) {
    .webhooks-grid {
        grid-template-columns: 1fr;
    }
    
    .header-section {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .header-section .btn {
        width: 100%;
    }
    
    .webhook-actions {
        flex-direction: column;
    }
}
