/**
 * FAANG-Style Design for Hepsijet API Relay
 * Clean, minimal, enterprise-grade aesthetic
 */

/* Reset and Base */
* {
    box-sizing: border-box;
}

/* Main Container */
.hepsijet-api-keys-wrapper {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #1a1a1a;
    line-height: 1.6;
    background: #ffffff;
}

/* Typography */
.hepsijet-api-keys-wrapper h3 {
    font-size: 2rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 1rem 0;
    letter-spacing: -0.025em;
}

.hepsijet-api-keys-wrapper h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 1rem 0;
    letter-spacing: -0.025em;
}

.hepsijet-api-keys-wrapper h5 {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 1.5rem 0 0.75rem 0;
}

.hepsijet-api-keys-wrapper p {
    color: #666666;
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
}

/* Header Section */
.hepsijet-header {
    text-align: center;
    padding: 0rem 0 2rem 0;
    border-bottom: 1px solid #e5e5e5;
    margin-bottom: 2rem;
}

.hepsijet-header .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.hepsijet-logo {
    max-width: 150px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.hepsijet-menu-logo {
    height: 20px;
    width: auto;
    vertical-align: middle;
    margin-right: 8px;
    display: inline-block;
    flex-shrink: 0;
}

/* Tailwind CSS compatible styles */
nav .hepsijet-menu-logo,
.woocommerce-MyAccount-navigation .hepsijet-menu-logo {
    height: 1.25rem; /* h-5 equivalent */
    width: 1.25rem; /* w-5 equivalent */
    margin-right: 0.5rem;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

.hepsijet-header h3 {
    margin-bottom: 0.5rem;
}

.hepsijet-header p {
    max-width: 600px;
    margin: 0 auto;
    color: #666666;
}

/* Company Settings Section */
.hepsijet-company-settings {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.company-settings-display {
    background: #fafafa;
    padding: 1.5rem;
    border-radius: 6px;
    border: 1px solid #e5e5e5;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.setting-item {
    background: #ffffff;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #e5e5e5;
}

.setting-item strong {
    color: #1a1a1a;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 0.5rem;
}

.setting-item span {
    color: #1a1a1a;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    background: #f5f5f5;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    border: 1px solid #e5e5e5;
    display: block;
    word-break: break-all;
}

/* API Key Creation Section */
.api-key-creation {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.api-key-creation h4 {
    margin-bottom: 1.5rem;
}

.api-key-creation form p {
    margin-bottom: 1.5rem;
}

.api-key-creation label {
    display: block;
    width: 100%;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #1a1a1a;
    font-size: 0.9rem;
}

.api-key-creation .input-text {
    width: 100%;
    max-width: 400px;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.15s ease-in-out;
    background: #ffffff;
}

.api-key-creation .input-text:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.api-key-creation .button {
    background: #2563eb;
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.api-key-creation .button:hover {
    background: #1d4ed8;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* New API Key Display */
#new-api-key-display {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

#new-api-key-display h4 {
    color: #0369a1;
    margin: 0 0 1rem 0;
}

#new-api-key-display p {
    color: #0369a1;
    margin-bottom: 1rem;
}

.api-key-details {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: #ffffff;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e5e5e5;
}

.api-key-details th,
.api-key-details td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e5e5;
}

.api-key-details th {
    background: #f8fafc;
    color: #374151;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.api-key-details code {
    background: #f1f5f9;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    font-size: 0.85rem;
    word-break: break-all;
    border: 1px solid #e2e8f0;
}

/* Existing API Keys Table */
.shop_table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e5e5;
    margin: 1.5rem 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.shop_table thead {
    background: #f8fafc;
}

.shop_table th {
    padding: 1rem;
    text-align: left;
    color: #374151;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e5e5e5;
}

.shop_table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.shop_table tbody tr:hover {
    background: #f8fafc;
}

.shop_table tbody tr:last-child td {
    border-bottom: none;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    border: none;
    text-transform: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: #2563eb;
    color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-success {
    background: #10b981;
    color: #ffffff;
    margin-top: 1rem;
}

.btn-success:hover {
    background: #059669;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Button Small Styles */
.button-small {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    line-height: 1.4;
    margin-right: 0.5rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
    border: 1px solid;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    background: transparent;
}

.copy-btn {
    background: #10b981;
    color: #ffffff;
    border-color: #10b981;
}

.copy-btn:hover {
    background: #059669;
    border-color: #059669;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.delete-key-btn {
    background: #ef4444;
    color: #ffffff !important;
    border-color: #ef4444;
}

.delete-key-btn:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

/* Registration Form Styles */
.hepsijet-registration-form,
.hepsijet-address-update-form {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 2rem;
    margin: 1.5rem 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.hepsijet-registration-form .info-box,
.hepsijet-address-update-form .info-box {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
}

.hepsijet-registration-form .info-box .icon,
.hepsijet-address-update-form .info-box .icon {
    font-size: 1.25rem;
    margin-right: 0.75rem;
    color: #0369a1;
}

.hepsijet-registration-form .info-box .text,
.hepsijet-address-update-form .info-box .text {
    color: #0369a1;
    font-size: 0.9rem;
    line-height: 1.5;
    font-weight: 500;
}

.hepsijet-registration-form .form-grid,
.hepsijet-address-update-form .form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.hepsijet-registration-form .form-group,
.hepsijet-address-update-form .form-group {
    position: relative;
}

.hepsijet-registration-form .form-group.full-width,
.hepsijet-address-update-form .form-group.full-width {
    grid-column: 1 / -1;
}

.hepsijet-registration-form .form-label,
.hepsijet-address-update-form .form-label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.hepsijet-registration-form .required,
.hepsijet-address-update-form .required {
    color: #ef4444;
    margin-left: 0.25rem;
    font-weight: 600;
}

.hepsijet-registration-form .form-input,
.hepsijet-address-update-form .form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.15s ease-in-out;
    background: #ffffff;
}

.hepsijet-registration-form .form-input:focus,
.hepsijet-address-update-form .form-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.hepsijet-registration-form .form-input::placeholder,
.hepsijet-address-update-form .form-input::placeholder {
    color: #9ca3af;
}

.hepsijet-registration-form .form-input.completed,
.hepsijet-address-update-form .form-input.completed {
    border-color: #10b981;
    background: #f0fdf4;
}

.hepsijet-registration-form .form-input.error,
.hepsijet-address-update-form .form-input.error {
    border-color: #ef4444;
}

.hepsijet-registration-form .additional-fields {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.hepsijet-registration-form .additional-fields.show {
    opacity: 1;
    max-height: 1200px;
    overflow: visible;
}

.hepsijet-registration-form .section-divider {
    margin: 2rem 0;
    border-top: 1px solid #e5e5e5;
    position: relative;
}

.hepsijet-registration-form .section-divider::after {
    content: '📍';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #ffffff;
    padding: 0 1rem;
    font-size: 1rem;
}

.hepsijet-registration-form .checkbox-group,
.hepsijet-address-update-form .checkbox-group {
    display: flex;
    align-items: center;
    margin: 1rem 0;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.hepsijet-registration-form .checkbox-group input[type="checkbox"],
.hepsijet-address-update-form .checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 0.75rem;
    accent-color: #2563eb;
    cursor: pointer;
}

.hepsijet-registration-form .checkbox-group label,
.hepsijet-address-update-form .checkbox-group label {
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.5;
    cursor: pointer;
    font-weight: 500;
}

/* Return Address Section */
.return-address-section {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #fef3c7;
    border-radius: 6px;
    padding: 0;
    margin: 1rem 0;
    border: 1px solid #fbbf24;
}

.return-address-section.show {
    opacity: 1;
    max-height: 600px;
    padding: 1rem;
}

.return-address-section h3 {
    color: #92400e;
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    font-weight: 600;
}

/* Success Message */
.success-message {
    text-align: center;
    padding: 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    display: none;
    background: #f0f9ff;
    border-radius: 8px;
    border: 1px solid #bae6fd;
}

.success-message.active {
    opacity: 1;
    transform: translateY(0);
    display: block;
}

.success-icon {
    width: 60px;
    height: 60px;
    background: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: #ffffff;
    font-size: 1.5rem;
}

/* Error Messages */
.error-message {
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: none;
    font-weight: 500;
}

/* Section Headers */
.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header .icon {
    font-size: 1.5rem;
    margin-right: 0.75rem;
    opacity: 0.7;
}

/* Notices */
.notice {
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
    border-left: 4px solid;
}

.notice.notice-info {
    background: #f0f9ff;
    border-left-color: #2563eb;
    color: #1e40af;
}

.notice.notice-success {
    background: #f0fdf4;
    border-left-color: #10b981;
    color: #047857;
}

.notice.notice-warning {
    background: #fffbeb;
    border-left-color: #f59e0b;
    color: #92400e;
}

.notice.notice-error {
    background: #fef2f2;
    border-left-color: #ef4444;
    color: #dc2626;
}

/* Notification System */
.hepsijet-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 350px;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.3s ease-out;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.notification-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.notification-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.notification-content {
    display: flex;
    align-items: flex-start;
    padding: 1rem 1.25rem;
    gap: 0.75rem;
}

.notification-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.notification-text {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.notification-message {
    font-size: 0.85rem;
    opacity: 0.95;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.15s ease;
    opacity: 0.8;
}

.notification-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
    opacity: 1;
}

/* Responsive notifications */
@media (max-width: 768px) {
    .hepsijet-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hepsijet-api-keys-wrapper {
        margin: 1rem 0;
    }
    
    .hepsijet-header {
        padding: 2rem 0 1.5rem 0;
    }
    
    .hepsijet-company-settings,
    .api-key-creation,
    .hepsijet-registration-form,
    .hepsijet-address-update-form {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .settings-grid,
    .hepsijet-registration-form .form-grid,
    .hepsijet-address-update-form .form-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .shop_table {
        font-size: 0.8rem;
    }
    
    .shop_table th,
    .shop_table td {
        padding: 0.75rem;
    }
    
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #f3f4f6;
    border-top: 2px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Focus states for accessibility */
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Subtle hover effects */
button:hover,
input:hover,
select:hover,
textarea:hover {
    border-color: #9ca3af;
}

/* Custom scrollbar */
.hepsijet-registration-form::-webkit-scrollbar,
.hepsijet-address-update-form::-webkit-scrollbar {
    width: 6px;
}

.hepsijet-registration-form::-webkit-scrollbar-track,
.hepsijet-address-update-form::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.hepsijet-registration-form::-webkit-scrollbar-thumb,
.hepsijet-address-update-form::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.hepsijet-registration-form::-webkit-scrollbar-thumb:hover,
.hepsijet-address-update-form::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Basic Pricing Table Styles */
.hepsijet-pricing-section {
    margin-bottom: 2rem;
    padding: 1rem;
    border: 1px solid #ddd;
    background: #fff;
}

.hepsijet-pricing-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
}

.hepsijet-pricing-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.hepsijet-pricing-table th,
.hepsijet-pricing-table td {
    padding: 0.5rem;
    border: 1px solid #ddd;
    text-align: left;
}

.hepsijet-pricing-table th {
    background: #f5f5f5;
    font-weight: bold;
}

.hepsijet-pricing-section p {
    margin: 0;
    color: #666;
}

/* Minimal Phone Verification Styles */
.phone-verification-status {
    margin-left: 10px;
    font-size: 0.8rem;
    font-weight: 500;
}

.phone-verification-status.verified {
    color: #059669;
}

.phone-verification-status.unverified {
    color: #dc2626;
}

.phone-verification-section {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid #ddd;
    background: #f9f9f9;
}

.phone-verification-section h5 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
}

.phone-verification-section p {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
}

#verificationCode {
    width: 120px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    text-align: center;
    font-family: monospace;
    margin-right: 0.5rem;
}

.verification-result {
    margin-top: 1rem;
    padding: 0.5rem;
    border-radius: 4px;
}

.verification-result.notice-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.verification-result.notice-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}