/* Main CSS - Cross-browser compatible */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1a73e8;
    --secondary-color: #5f6368;
    --success-color: #0f9d58;
    --warning-color: #f9ab00;
    --danger-color: #ea4335;
    --background: #f8f9fa;
    --surface: #ffffff;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --border: #dadce0;
    --shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.app-header {
    background: var(--surface);
    padding: 20px 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.app-header h1 {
    color: var(--text-primary);
    font-size: 28px;
    margin: 10px 0;
}

.header-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.back-button {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    padding: 8px 0;
    transition: opacity 0.3s;
}

.back-button:hover {
    opacity: 0.7;
}

/* Panel styles */
.panel {
    background: var(--surface);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.panel h2 {
    color: var(--text-primary);
    font-size: 20px;
    margin-bottom: 15px;
}

.divider {
    height: 1px;
    background: var(--border);
    margin: 15px 0;
}

/* Form styles */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 5px;
    font-weight: 500;
}

input[type="text"],
input[type="number"],
input[type="tel"],
input[type="email"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
    background: var(--surface);
    transition: border-color 0.3s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
}

/* Button styles */
button {
    cursor: pointer;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 20px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary,
.primary-btn,
.action-btn {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover,
.primary-btn:hover,
.action-btn:hover {
    background: #1557b0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-secondary,
.standard-btn {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover,
.standard-btn:hover {
    background: var(--background);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--surface);
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    color: var(--text-primary);
    font-size: 20px;
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}

.close-modal:hover {
    background: var(--background);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid var(--border);
}

/* Copy notification */
.copy-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--success-color);
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    display: none;
    align-items: center;
    gap: 10px;
    z-index: 2000;
    animation: slideUp 0.3s;
}

.copy-notification.show {
    display: flex;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Edge-specific fixes */
@supports (-ms-ime-align: auto) {
    input[type="number"] {
        -moz-appearance: textfield;
    }
    
    input[type="number"]::-webkit-inner-spin-button,
    input[type="number"]::-webkit-outer-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }
}

/* Loading spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .app-container {
        padding: 10px;
    }
    
    .app-header {
        padding: 15px 20px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
}

/* Browser warning */
.browser-warning {
    background: var(--warning-color);
    color: white;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.browser-warning h3 {
    margin-bottom: 10px;
}

.browser-warning ul {
    margin-left: 20px;
}

/* Utility classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.copyable {
    cursor: pointer;
    position: relative;
    text-decoration: underline;
    text-decoration-style: dotted;
}

.copyable:hover {
    color: var(--primary-color);
}

.copyable::after {
    content: "Click to copy";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.copyable:hover::after {
    opacity: 1;
}