/* Modern SaaS Dashboard - Tailwind/Vercel/Linear Inspired */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Modern Color Palette */
    --color-bg: #fafafa;
    --color-surface: #ffffff;
    --color-border: #e5e7eb;
    --color-border-hover: #d1d5db;
    
    --color-text-primary: #0f172a;
    --color-text-secondary: #64748b;
    --color-text-tertiary: #94a3b8;
    
    --color-primary: #6366f1;
    --color-primary-hover: #4f46e5;
    --color-primary-light: #eef2ff;
    
    --color-danger: #ef4444;
    --color-danger-hover: #dc2626;
    --color-danger-light: #fee2e2;
    
    --color-warning: #fbbf24;
    --color-warning-light: #fef3c7;
    
    --color-success: #10b981;
    --color-success-light: #d1fae5;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 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);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Border radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Transitions */
    --transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--color-bg);
    min-height: 100vh;
    color: var(--color-text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Login Page */
body.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-box {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: 48px;
    box-shadow: var(--shadow-xl);
}

.login-box h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 8px;
    text-align: center;
    letter-spacing: -0.025em;
}

.subtitle {
    text-align: center;
    color: var(--color-text-secondary);
    margin-bottom: 40px;
    font-size: 15px;
}

/* Form Elements */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-primary);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 15px;
    transition: var(--transition);
    background: var(--color-surface);
    color: var(--color-text-primary);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.form-group input::placeholder {
    color: var(--color-text-tertiary);
}

/* Buttons */
.btn {
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-primary {
    width: 100%;
    padding: 13px;
    background: var(--color-primary);
    color: white;
    font-size: 15px;
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-bg);
    border-color: var(--color-border-hover);
}

.btn-danger {
    background: var(--color-danger-light);
    color: var(--color-danger);
    border: 1px solid transparent;
}

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

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
    border: none;
    padding: 8px 12px;
}

.btn-ghost:hover {
    background: var(--color-bg);
    color: var(--color-text-primary);
}

/* Icon buttons */
.icon-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--color-text-secondary);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: var(--color-bg);
    color: var(--color-text-primary);
}

.icon-btn.danger:hover {
    background: var(--color-danger-light);
    color: var(--color-danger);
}

/* Error Message */
.error-message {
    background: var(--color-danger-light);
    color: var(--color-danger);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid var(--color-danger);
}

/* Dashboard Layout */
.dashboard {
    max-width: 1600px;
    margin: 0 auto;
    padding: 32px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-text-primary);
    letter-spacing: -0.025em;
}

/* Actions Bar */
.actions-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 320px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 11px 16px 11px 40px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--color-surface);
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-tertiary);
    pointer-events: none;
}

/* Table Container */
.table-container {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}

th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 16px;
    border-top: 1px solid var(--color-border);
    font-size: 14px;
    color: var(--color-text-primary);
}

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background: var(--color-bg);
}

/* Domain name styling */
td strong {
    font-weight: 600;
    color: var(--color-text-primary);
}

/* Expiry warnings - Modern version */
.expiry-30 {
    background: linear-gradient(90deg, #fef2f2 0%, transparent 100%) !important;
}

.expiry-30 td:nth-child(4) {
    color: var(--color-danger);
    font-weight: 600;
}

.expiry-60 {
    background: linear-gradient(90deg, #fefce8 0%, transparent 100%) !important;
}

.expiry-60 td:nth-child(4) {
    color: #ca8a04;
    font-weight: 600;
}

/* Badge styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid;
}

.badge-primary {
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.badge-success {
    background: var(--color-success-light);
    color: var(--color-success);
    border-color: var(--color-success);
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    z-index: 1000;
    padding: 4px;
    display: none;
}

.dropdown-menu.show {
    display: block;
    animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--color-text-primary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background: var(--color-bg);
}

.dropdown-item.danger:hover {
    background: var(--color-danger-light);
    color: var(--color-danger);
}

.dropdown-divider {
    height: 1px;
    background: var(--color-border);
    margin: 4px 0;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease-out;
}

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

.modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--color-border);
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0;
}

.modal-body {
    padding: 32px;
}

.modal-footer {
    padding: 20px 32px;
    border-top: 1px solid var(--color-border);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-footer .btn {
    min-width: 100px;
}

/* Loading */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-secondary);
    font-size: 15px;
}

/* Tooltip */
.tooltip {
    position: absolute;
    background: var(--color-text-primary);
    color: white;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 13px;
    white-space: nowrap;
    z-index: 10000;
    pointer-events: none;
    box-shadow: var(--shadow-lg);
}

.tooltip::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 4px solid var(--color-text-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard {
        padding: 20px;
    }
    
    .actions-bar {
        flex-direction: column;
    }
    
    .search-box {
        min-width: 100%;
    }
    
    table {
        font-size: 13px;
    }
    
    th, td {
        padding: 12px 10px;
    }
    
    .login-box {
        padding: 32px 24px;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border-hover);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-tertiary);
}
