/* Kispay Checkout Portal - Modern CSS */
/* Color Scheme: Primary #F58634, Secondary #3E4095 */
/* Font: Bebas Neue */

:root {
    --primary-color: hsl(240, 41%, 30%);
    --primary-light: #ff9d4d;
    --primary-dark: #e07529;
    --secondary-color: #3E4095;
    --secondary-light: #5855b8;
    --secondary-dark: #F58634;
    
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --text-light: #ecf0f1;
    --text-white: #ffffff;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-dark: #2c3e50;
    --bg-overlay: rgba(0, 0, 0, 0.6);
    
    --border-color: #e9ecef;
    --border-primary: var(--primary-color);
    --border-secondary: var(--secondary-color);
    --border-radius: 12px;
    --border-radius-small: 8px;
    
    --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.15);
    --shadow-heavy: 0 8px 30px rgba(0, 0, 0, 0.2);
    
    --font-bebas: 'Bebas Neue', sans-serif;
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s ease;
}

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

body {
    font-family: var(--font-primary);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, #e9ecef 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: none;
    margin: 0;
    padding: 20px 40px;
    min-height: 100vh;
}

/* Header Navigation Styles */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: center;
    margin-bottom: 20px;
    padding: 20px 40px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.header-nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.header-nav .nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    font-family: 'Bebas Neue', cursive;
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.header-nav .nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    color: white;
}

.header-nav .nav-btn.active {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.header-nav .nav-icon {
    font-size: 1.25rem;
}

.header-nav .nav-text {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.logo .brand-name {
    font-family: var(--font-bebas);
    font-size: 3rem;
    font-weight: 400;
    color: var(--text-white);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 3px;
    margin-bottom: 5px;
}

.logo .brand-subtitle {
    font-size: 1rem;
    color: var(--text-light);
    font-weight: 300;
    letter-spacing: 1.5px;
}

/* Responsive Header Navigation */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
        padding: 15px 20px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .header-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .header-nav .nav-btn {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
    
    .logo .brand-name {
        font-size: 2.5rem;
        letter-spacing: 2px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 12px 15px;
        margin-bottom: 12px;
    }
    
    .header-nav .nav-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .header-nav .nav-icon {
        font-size: 1rem;
    }
    
    .header-nav .nav-text {
        font-size: 0.8rem;
    }
    
    .logo .brand-name {
        font-size: 2rem;
        letter-spacing: 1.5px;
    }
}

/* Full screen header optimization */
@media (min-width: 1400px) {
    .header {
        padding: 15px 40px;
        margin-bottom: 15px;
    }
    
    .logo .brand-name {
        font-size: 3rem;
    }
    
    .brand-subtitle {
        font-size: 1rem;
    }
}

.logo .brand-name {
    font-family: var(--font-bebas);
    font-size: 4rem;
    font-weight: 400;
    color: var(--text-white);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 4px;
    margin-bottom: 8px;
}

.logo .brand-subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    font-weight: 300;
    letter-spacing: 2px;
}

/* Main Content */
.main-content {
    display: grid;
    gap: 30px;
    grid-template-columns: 1fr;
}

/* Full screen layout optimization */
@media (min-width: 1400px) {
    .main-content {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
    
    .checkout-section {
        grid-column: 1;
    }
    
    .status-section {
        grid-column: 1;
    }
    
    .sessions-section {
        grid-column: 2;
        grid-row: 1 / span 2;
        max-height: 80vh;
    }
    
    .webhooks-section {
        grid-column: 2;
    }
}

@media (min-width: 1800px) {
    .main-content {
        grid-template-columns: 2fr 1fr;
    }
    
    .sessions-section {
        max-height: 90vh;
    }
}

.section {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    overflow: hidden;
    transition: var(--transition);
}

.section:hover {
    box-shadow: var(--shadow-medium);
}

.section-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-dark) 100%);
    color: var(--text-white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.section-title-group {
    text-align: left;
    flex: 1;
    min-width: 200px;
}

.section-title {
    font-family: var(--font-bebas);
    font-size: 2rem;
    font-weight: 400;
    letter-spacing: 1px;
    margin: 0;
}

.section-description {
    font-size: 0.8rem;
    opacity: 0.9;
    margin: 3px 0 0 0;
}

/* Checkout Form */
.checkout-section .section-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.checkout-form {
    padding: 20px;
    display: grid;
    gap: 15px;
}

/* Full screen form optimization */
@media (min-width: 1400px) {
    .checkout-form {
        padding: 15px 25px;
        gap: 12px;
    }
    
    .form-input {
        padding: 12px 18px;
        font-size: 1rem;
    }
    
    .form-actions {
        margin-top: 8px;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-label {
        font-weight: 600;
        color: var(--text-primary);
        font-size: 0.9rem;
        letter-spacing: 0.3px;
    }

.form-input {
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-small);
    font-size: 1rem;
    transition: var(--transition-fast);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(245, 134, 52, 0.1);
    transform: translateY(-1px);
}

.form-input:read-only {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: not-allowed;
}

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

.form-input-required:invalid:not(:placeholder-shown) {
    border-color: #e74c3c;
}

.form-input-required:valid:not(:placeholder-shown) {
    border-color: var(--primary-color);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius-small);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    letter-spacing: 0.5px;
    font-family: var(--font-primary);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--text-white);
    box-shadow: var(--shadow-light);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-dark) 100%);
    color: var(--text-white);
    box-shadow: var(--shadow-light);
}

.btn-secondary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

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

.btn-outline:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.form-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Status Section */
.status-card {
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    border-left: 5px solid var(--primary-color);
}

.status-icon {
    font-size: 3rem;
    min-width: 60px;
    text-align: center;
}

.status-content h3 {
    font-family: var(--font-bebas);
    font-size: 2rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.status-content p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.payment-details {
    padding: 0 30px 30px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.detail-label {
    font-weight: 600;
    color: var(--text-primary);
}

.detail-value {
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}

.action-links {
    margin-top: 20px;
    text-align: center;
}

.payment-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--text-white);
    text-decoration: none;
    border-radius: var(--border-radius-small);
    transition: var(--transition-fast);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.payment-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* Sessions Section */
.sessions-container {
    padding: 30px;
    max-height: 400px;
    overflow-y: auto;
}

.sessions-list {
    display: grid;
    gap: 15px;
}

/* Full screen sessions optimization */
@media (min-width: 1400px) {
    .sessions-container {
        max-height: 80vh;
    }
    
    .sessions-section {
        overflow: hidden;
    }
}

.session-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-small);
    padding: 20px;
    transition: var(--transition-fast);
    cursor: pointer;
}

.session-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
    border-color: var(--primary-color);
}

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

.session-id {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: var(--text-primary);
}

.session-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.session-status.status-pending {
    background: rgba(241, 196, 15, 0.2);
    color: #f39c12;
}

.session-status.status-completed {
    background: rgba(39, 174, 96, 0.2);
    color: #27ae60;
}

.session-status.status-failed {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.session-status.status-canceled {
    background: rgba(149, 165, 166, 0.2);
    color: #95a5a6;
}

.session-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
    font-family: var(--font-bebas);
}

.session-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Webhooks Section */
.webhook-feed {
    padding: 30px;
    max-height: 400px;
    overflow-y: auto;
}

/* Full screen webhooks optimization */
@media (min-width: 1400px) {
    .webhook-feed {
        max-height: 60vh;
    }
}

.webhook-event {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-small);
    padding: 20px;
    margin-bottom: 15px;
    transition: var(--transition-fast);
}

.webhook-event:hover {
    box-shadow: var(--shadow-light);
}

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

.webhook-type {
    display: flex;
    align-items: center;
    gap: 8px;
}

.type-icon {
    font-size: 1.25rem;
}

.type-text {
    font-weight: 600;
    color: var(--text-primary);
}

.webhook-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.verified {
    background: rgba(39, 174, 96, 0.2);
    color: #27ae60;
}

.status-badge.unverified {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.webhook-time {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.webhook-details p {
    margin: 8px 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.webhook-details code {
    background: var(--bg-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: var(--secondary-color);
}

.webhook-details .error {
    color: #e74c3c;
    font-weight: 600;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-family: var(--font-bebas);
    font-size: 1.8rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

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

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-overlay);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 1000;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-text {
    color: var(--text-white);
    font-size: 1.1rem;
    font-weight: 600;
}

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

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-heavy);
    padding: 20px;
    display: none;
    align-items: center;
    gap: 15px;
    min-width: 300px;
    max-width: 500px;
    z-index: 1001;
    animation: slideIn 0.3s ease-out;
}

.notification.show {
    display: flex;
}

.notification.success {
    border-left: 5px solid #27ae60;
}

.notification.error {
    border-left: 5px solid #e74c3c;
}

.notification.warning {
    border-left: 5px solid #f39c12;
}

.notification.info {
    border-left: 5px solid var(--primary-color);
}

.notification-icon {
    font-size: 1.5rem;
    min-width: 24px;
}

.notification-content {
    flex: 1;
}

.notification-message {
    font-weight: 600;
    color: var(--text-primary);
}

.notification-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.notification-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Controls */
.webhook-controls {
    display: flex;
    gap: 10px;
}

.btn-icon {
    font-size: 1rem;
}

.btn-text {
    font-size: 0.875rem;
}

/* Enhanced Responsive Design */
@media (max-width: 1399px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .sessions-container,
    .webhook-feed {
        max-height: 400px;
    }
    
    .logo .brand-name {
        font-size: 2.8rem;
    }
    
    .header {
        padding: 18px 20px;
        margin-bottom: 18px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .logo .brand-name {
        font-size: 2.5rem;
        letter-spacing: 2px;
    }
    
    .logo .brand-subtitle {
        font-size: 0.9rem;
    }
    
    .section-header {
        padding: 15px 20px;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        justify-content: center;
    }
    
    .status-card {
        flex-direction: column;
        text-align: center;
    }
    
    .session-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .webhook-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .webhook-meta {
        flex-wrap: wrap;
    }
    
    .detail-row {
        flex-direction: column;
        gap: 5px;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        min-width: auto;
    }
    
    .webhook-feed,
    .sessions-container {
        max-height: 300px;
    }
    
    .header {
        padding: 15px 15px;
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .logo .brand-name {
        font-size: 2rem;
        letter-spacing: 1.5px;
    }
    
    .logo .brand-subtitle {
        font-size: 0.8rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .form-input {
        padding: 12px 16px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .session-card,
    .webhook-event {
        padding: 15px;
    }
    
    .webhook-feed,
    .sessions-container {
        max-height: 250px;
    }
    
    .header {
        padding: 12px 15px;
        margin-bottom: 12px;
    }
}

/* Extra large screens optimization */
@media (min-width: 2400px) {
    .container {
        padding: 30px 60px;
    }
    
    .main-content {
        gap: 40px;
    }
    
    .logo .brand-name {
        font-size: 5rem;
    }
    
    .section-title {
        font-size: 3.5rem;
    }
    
    .checkout-form {
        padding: 25px 40px;
        gap: 20px;
    }
    
    .form-input {
        padding: 15px 20px;
        font-size: 1.1rem;
    }
    
    .btn {
        padding: 15px 30px;
        font-size: 1.1rem;
    }
}