/**
 * Portal Teknisi - Premium UI Styles
 * Modern, elegant design with glassmorphism & animations
 */

/* ===== CSS Variables ===== */
:root {
    /* Primary Colors */
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --primary-light: #7c86ea;
    
    /* Secondary Colors */
    --secondary: #764ba2;
    --secondary-dark: #6b42a3;
    
    /* Accent Colors */
    --accent-pink: #ec4899;
    --accent-cyan: #06b6d4;
    --accent-green: #10b981;
    --accent-orange: #f59e0b;
    --accent-red: #ef4444;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --gradient-info: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    
    /* Background */
    --bg-main: #f0f2f5;
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-glass: rgba(255, 255, 255, 0.7);
    
    /* Text */
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 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);
    --shadow-glow: 0 0 40px rgba(102, 126, 234, 0.3);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-main);
    background-image: 
        radial-gradient(at 40% 20%, rgba(102, 126, 234, 0.15) 0px, transparent 50%),
        radial-gradient(at 80% 0%, rgba(118, 75, 162, 0.1) 0px, transparent 50%),
        radial-gradient(at 0% 50%, rgba(236, 72, 153, 0.1) 0px, transparent 50%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===== Glassmorphism Card ===== */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-lg);
}

.glass-card:hover {
    box-shadow: var(--shadow-xl);
}

/* ===== Container ===== */
.container {
    padding-left: 20px;
    padding-right: 20px;
    max-width: 500px;
    margin: 0 auto;
}

/* ===== Animated Background Shapes ===== */
.bg-shapes {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    overflow: hidden;
}

.bg-shapes::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 20s ease-in-out infinite;
}

.bg-shapes::after {
    content: '';
    position: absolute;
    bottom: -150px;
    left: -150px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 25s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, 30px); }
}

/* ===== Page Header ===== */
.page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px;
    background: var(--gradient-primary);
    margin-left: -20px;
    margin-right: -20px;
    margin-top: -20px;
    padding-top: 30px;
    padding-bottom: 30px;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    color: white;
}

.page-header i {
    font-size: 28px;
    opacity: 0.9;
}

.page-header h4 {
    font-weight: 700;
    font-size: 22px;
    margin: 0;
}

/* ===== Gradient Cards ===== */
.gradient-card {
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--radius-xl);
    padding: 28px 24px;
    position: relative;
    overflow: hidden;
}

.gradient-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 60%);
    pointer-events: none;
}

.gradient-card.stat-open {
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
}

.gradient-card.stat-progress {
    background: var(--gradient-primary);
}

.gradient-card.stat-closed {
    background: var(--gradient-success);
}

.stat-icon {
    font-size: 36px;
    margin-bottom: 8px;
    opacity: 0.9;
}

.stat-value {
    font-size: 42px;
    font-weight: 800;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 8px;
    font-weight: 500;
}

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stats-grid .gradient-card {
    padding: 20px 16px;
    text-align: center;
}

.stats-grid .stat-value {
    font-size: 32px;
}

.stats-grid .stat-icon {
    font-size: 28px;
}

/* ===== Modern Card ===== */
.modern-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 20px;
    margin-bottom: 16px;
    border: none;
    transition: all var(--transition-normal);
}

.modern-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.modern-card:active {
    transform: scale(0.98);
}

/* ===== Section Title ===== */
.section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--text-muted), transparent);
}

/* ===== Badge Styles ===== */
.badge {
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-open {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    color: #be185d;
}

.badge-progress {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1d4ed8;
}

.badge-closed {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #047857;
}

.badge i {
    font-size: 10px;
}

/* ===== Buttons ===== */
.btn {
    border-radius: var(--radius-md);
    padding: 14px 24px;
    font-weight: 600;
    border: none;
    transition: all var(--transition-normal);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary-custom {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.btn-success-custom {
    background: var(--gradient-success);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-success-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
}

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

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

.btn-outline-custom {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

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

.btn-lg {
    padding: 18px 28px;
    font-size: 15px;
}

.btn-sm {
    padding: 10px 16px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: var(--radius-md);
}

/* ===== Action Grid ===== */
.action-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    text-decoration: none;
    color: var(--text-primary);
    border: none;
    cursor: pointer;
}

.action-btn:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.action-btn:active {
    transform: scale(0.95);
}

.action-btn i {
    font-size: 32px;
    margin-bottom: 8px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.action-btn span {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ===== Ticket Card ===== */
.ticket-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.ticket-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.03) 0%, transparent 100%);
    pointer-events: none;
}

.ticket-card:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.ticket-card.ticket-open {
    border-left-color: #ec4899;
}

.ticket-card.ticket-progress {
    border-left-color: var(--primary);
}

.ticket-card.ticket-closed {
    border-left-color: #10b981;
}

.ticket-title {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.ticket-meta {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ticket-meta i {
    width: 16px;
    opacity: 0.7;
}

.ticket-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}

/* ===== Detail Card ===== */
.detail-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 16px;
}

.detail-header {
    background: var(--gradient-primary);
    color: white;
    padding: 20px;
}

.detail-body {
    padding: 20px;
}

.detail-row {
    padding: 14px 0;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-label i {
    font-size: 14px;
}

.detail-value {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
}

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

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: block;
}

.form-control {
    width: 100%;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: var(--radius-md);
    font-size: 16px;
    transition: all var(--transition-fast);
    background: white;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    outline: none;
}

.form-select {
    width: 100%;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: var(--radius-md);
    font-size: 16px;
    background: white;
    cursor: pointer;
}

/* ===== Input Group ===== */
.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
    z-index: 10;
}

.input-icon + .form-control {
    padding-left: 48px;
}

/* ===== Alert Styles ===== */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
}

.alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    border-left: 4px solid #10b981;
    color: #047857;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
    border-left: 4px solid #ef4444;
    color: #dc2626;
}

.alert-info {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1) 0%, rgba(6, 182, 212, 0.05) 100%);
    border-left: 4px solid #06b6d4;
    color: #0891b2;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
    border-left: 4px solid #f59e0b;
    color: #d97706;
}

.alert i {
    font-size: 20px;
    margin-top: 2px;
}

/* ===== Profile Card ===== */
.profile-header {
    text-align: center;
    padding: 40px 20px;
    background: var(--gradient-primary);
    border-radius: var(--radius-xl);
    color: white;
    margin-bottom: 24px;
    position: relative;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
}

.profile-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.profile-role {
    font-size: 14px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* ===== History Card ===== */
.history-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    position: relative;
    padding-left: 36px;
}

.history-card::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 20px;
    bottom: 20px;
    width: 2px;
    background: linear-gradient(to bottom, #10b981, transparent);
}

.history-card::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 24px;
    width: 14px;
    height: 14px;
    background: #10b981;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 2px #10b981;
}

.history-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 8px;
}

.history-meta {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 72px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    display: block;
}

.empty-state h5 {
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 14px;
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in {
    animation: fadeInUp 0.5s ease forwards;
}

.slide-in {
    animation: slideIn 0.4s ease forwards;
}

/* Staggered animations */
.animated-item:nth-child(1) { animation-delay: 0.1s; }
.animated-item:nth-child(2) { animation-delay: 0.15s; }
.animated-item:nth-child(3) { animation-delay: 0.2s; }
.animated-item:nth-child(4) { animation-delay: 0.25s; }
.animated-item:nth-child(5) { animation-delay: 0.3s; }
.animated-item:nth-child(6) { animation-delay: 0.35s; }

/* ===== Responsive ===== */
@media (max-width: 400px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .stats-grid .gradient-card {
        padding: 16px 12px;
    }
    
    .stats-grid .stat-value {
        font-size: 24px;
    }
    
    .stats-grid .stat-icon {
        font-size: 22px;
    }
    
    .action-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== Utility Classes ===== */
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 20px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 20px; }
.py-4 { padding-top: 24px; padding-bottom: 24px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.text-primary { color: var(--primary) !important; }
.text-success { color: #10b981 !important; }
.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.gap-2 { gap: 8px; }
.w-100 { width: 100%; }

/* ===== Map Container ===== */
.map-container {
    height: calc(100vh - 200px);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 80px;
    box-shadow: var(--shadow-lg);
}

/* ===== Loading Spinner ===== */
.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ===== Back Button ===== */
.back-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    color: white;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

