
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #10b981;
    --background: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
}

.sim-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.sim-header {
    text-align: center;
    margin-bottom: 3rem;
}

.sim-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.sim-header p {
    font-size: 1.125rem;
    color: var(--text-light);
}

.sim-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.plan-info {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    text-align: center;
}

.plan-info h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.plan-price {
    font-size: 2rem;
    font-weight: 700;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--surface);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

.btn-activate {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.btn-activate:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -8px var(--primary);
}

.sim-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.feature {
    text-align: center;
    padding: 1rem;
    background: var(--background);
    border-radius: 8px;
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Message Display Styles */
.message-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 90%;
    max-width: 600px;
}

.message {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    border-left: 4px solid;
    animation: slideDown 0.3s ease-out;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.message.success {
    background: #f0fdf4;
    border-left-color: var(--success);
    color: #065f46;
}

.message.error {
    background: #fef2f2;
    border-left-color: var(--error);
    color: #991b1b;
}

.message.warning {
    background: #fffbeb;
    border-left-color: var(--warning);
    color: #92400e;
}

.message.info {
    background: #eff6ff;
    border-left-color: var(--info);
    color: #1e40af;
}

.message-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.message-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.message-text {
    font-weight: 500;
}

.message-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.7;
    padding: 0.25rem;
    border-radius: 4px;
    transition: opacity 0.2s ease;
}

.message-close:hover {
    opacity: 1;
    background: rgba(0,0,0,0.1);
}

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

.message.hiding {
    animation: slideUp 0.3s ease-in forwards;
}

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

.activations {
    width: 100%;
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    border-collapse: collapse;
    overflow: hidden;
    margin-top: 1rem;
}

.activations thead {
    background: var(--background);
    border-bottom: 2px solid var(--border);
}

.activations thead tr {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}

.activations thead td {
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: var(--text);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.activations thead td:nth-child(1) {
    width: 35%;
}

.activations thead td:nth-child(2) {
    width: 35%;
}

.activations thead td:nth-child(3) {
    width: 30%;
}

.activations tbody tr {
    border-bottom: 1px solid var(--border);
    transition: all 0.2s ease;
}

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

.activations tbody tr:hover {
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.activations tbody td {
    padding: 1.25rem 1.5rem;
    vertical-align: middle;
    color: var(--text);
}

/* SIM Number Styling */
.activations tbody td:nth-child(1) {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
}

/* IMEI Styling */
.activations tbody td:nth-child(2) {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 400;
}

/* Status Message Styling */
.activations tbody td:nth-child(3) {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Specific Status Styles */
.activations tbody td.actdanger {
    color: #dc2626;
    background: #fef2f2;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border-left: 4px solid #dc2626;
    margin: -0.5rem 0;
    display: inline-block;
}

.activations tbody td.actsuccess {
    color: #059669;
    background: #f0fdf4;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border-left: 4px solid #059669;
    margin: -0.5rem 0;
    display: inline-block;
}

.activations tbody td.actwarning {
    color: #d97706;
    background: #fffbeb;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border-left: 4px solid #d97706;
    margin: -0.5rem 0;
    display: inline-block;
}

.activations tbody td:nth-child(3):contains("Expired"),
.activations tbody td:nth-child(3):contains("Cancelled") {
    color: #6b7280;
    background: #f9fafb;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border-left: 4px solid #6b7280;
    margin: -0.5rem 0;
    display: inline-block;
}

/* Empty IMEI Cell Styling */
.activations tbody td:nth-child(2):empty {
    color: #9ca3af;
    font-style: italic;
}

.activations tbody td:nth-child(2):empty::after {
    content: "Not provided";
    color: #9ca3af;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .activations {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .activations thead,
    .activations tbody {
        display: block;
    }
    
    .activations tr {
        display: table;
        width: 100%;
        table-layout: fixed;
    }
    
    .activations thead td,
    .activations tbody td {
        padding: 1rem;
        font-size: 0.8125rem;
    }
    
    .activations thead td:nth-child(1),
    .activations tbody td:nth-child(1) {
        width: 30%;
    }
    
    .activations thead td:nth-child(2),
    .activations tbody td:nth-child(2) {
        width: 30%;
    }
    
    .activations thead td:nth-child(3),
    .activations tbody td:nth-child(3) {
        width: 40%;
    }
}

/* Empty Table State */
.activations:empty::before {
    content: "No activation history available";
    display: block;
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-light);
    font-style: italic;
}

/* Loading State */
.activations.loading tbody tr {
    opacity: 0.6;
}

.activations.loading tbody td {
    position: relative;
}

.activations.loading tbody td::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Print Styles */
@media print {
    .activations {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .activations thead {
        background: #f0f0f0 !important;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
}

.error-message {
  color: #d32f2f;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

input.error {
  border-color: #d32f2f;
}