/* style.css - Main Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.login-box h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 24px;
}

.login-box h1 i {
    color: #667eea;
    margin-right: 10px;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.input-group input {
    width: 100%;
    padding: 12px 12px 12px 45px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.input-group input:focus {
    border-color: #667eea;
    outline: none;
}

button {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

button:hover {
    background: #764ba2;
}

.register-link {
    text-align: center;
    margin-top: 20px;
}

.register-link a {
    color: #667eea;
    text-decoration: none;
}

.referral-info {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

.referral-info a {
    color: #667eea;
    font-weight: bold;
}

.error {
    background: #ffebee;
    color: #c62828;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

.success {
    background: #e8f5e8;
    color: #2e7d32;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

/* Floating Telegram Icon */
.floating-telegram {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 1000;
}

.floating-telegram a {
    display: block;
    width: 60px;
    height: 60px;
    background: #0088cc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: transform 0.3s;
}

.floating-telegram a:hover {
    transform: scale(1.1);
}

/* Dashboard Styles */
.dashboard {
    width: 100%;
    min-height: 100vh;
    background: #f5f5f5;
}

.header {
    background: white;
    padding: 15px 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: #333;
    font-size: 20px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logout-btn {
    background: #dc3545;
    padding: 8px 15px;
    border-radius: 5px;
    color: white;
    text-decoration: none;
    font-size: 14px;
}

.dashboard-content {
    padding: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card i {
    font-size: 30px;
    color: #667eea;
    margin-bottom: 10px;
}

.stat-card h3 {
    font-size: 24px;
    color: #333;
    margin-bottom: 5px;
}

.stat-card p {
    color: #666;
    font-size: 14px;
}

.form-group {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.form-group h3 {
    margin-bottom: 15px;
    color: #333;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-row input, .form-row select {
    flex: 1;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.table {
    width: 100%;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.table table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #333;
}

.status-active {
    color: #28a745;
    font-weight: bold;
}

.status-expired {
    color: #dc3545;
    font-weight: bold;
}

.btn {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

/* Token Actions Styles */
.token-actions {
    display: flex;
    gap: 5px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.btn-danger {
    background: #dc3545 !important;
    color: white !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    text-decoration: none !important;
    display: inline-block !important;
}

.btn-danger:hover {
    background: #c82333 !important;
    transform: translateY(-1px);
}

/* Table responsive fixes */
.table table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.table th:nth-child(1) { width: 120px; } /* Token Code */
.table th:nth-child(2) { width: 150px; } /* Name */
.table th:nth-child(3) { width: 120px; } /* Expiry Date */
.table th:nth-child(4) { width: 200px; } /* Redirect URL */
.table th:nth-child(5) { width: 250px; } /* API URL */
.table th:nth-child(6) { width: 80px; }  /* Status */
.table th:nth-child(7) { width: 100px; } /* Actions */

.table td {
    word-wrap: break-word;
    vertical-align: middle;
}

/* Ensure buttons are visible */
.btn-sm {
    padding: 4px 8px !important;
    font-size: 12px !important;
    margin: 2px !important;
    min-width: auto !important;
    height: auto !important;
    line-height: 1 !important;
}

/* Token Edit Page Styles */
.token-info-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #007bff;
    margin-bottom: 20px;
}

.token-info-card p {
    margin: 8px 0;
    font-size: 14px;
}

.danger-zone {
    background: #f8d7da;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
    margin-top: 20px;
}

.danger-zone p {
    color: #721c24;
    margin-bottom: 15px;
}

/* Button styles */
.btn-primary {
    background: #007bff;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary:hover {
    background: #0056b3;
}