/* Link App Frontend Styles */

.link-app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
}

/* Header */
.link-app-header {
    background: #333;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    color: white;
}

.link-app-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.link-app-header h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
}

.link-app-user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
}

.welcome-text {
    opacity: 0.9;
}

.link-app-logout {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.link-app-logout:hover {
    background-color: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.6);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

/* Statistics Cards */
.link-app-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.link-app-stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 1px solid #e8ecef;
}

.link-app-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.stat-icon {
    font-size: 2rem;
    opacity: 0.8;
}

.stat-content {
    flex: 1;
}

.link-app-stat-card h3 {
    margin: 0 0 5px 0;
    color: #6c757d;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.link-app-stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: #2d3748;
    line-height: 1;
}

/* Tabbed Interface */
.link-app-tabs {
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

.link-app-tab-nav {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.link-app-tab-btn {
    flex: 1;
    padding: 18px 25px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.link-app-tab-btn:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.link-app-tab-btn.active {
    color: #667eea;
    background: white;
    border-bottom: 3px solid #667eea;
}

.link-app-tab-content {
    min-height: 400px;
}

.link-app-tab-panel {
    display: none;
    padding: 0;
}

.link-app-tab-panel.active {
    display: block;
}

/* Sections */
.link-app-section {
    padding: 30px;
}

.create-link-header {
    text-align: center;
    margin-bottom: 30px;
}

.create-link-header h2 {
    margin: 0 0 10px 0;
    color: #2d3748;
    font-size: 1.8rem;
    font-weight: 700;
}

.create-link-subtitle {
    color: #6c757d;
    font-size: 16px;
    margin: 0;
}

.manage-links-header {
    margin-bottom: 25px;
}

.manage-links-header h2 {
    margin: 0 0 15px 0;
    color: #2d3748;
    font-size: 1.8rem;
    font-weight: 700;
}

/* Forms */
.link-app-form {
    max-width: 100%;
    margin: 0 auto;
}

.link-app-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .link-app-form-grid {
        grid-template-columns: 2fr 1fr 1fr;
    }
}

.link-app-form-group {
    display: flex;
    flex-direction: column;
}

.link-app-form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #2d3748;
    font-size: 14px;
}

.link-app-form-group .required {
    color: #e53e3e;
}

.link-app-form-group input,
.link-app-form-group select,
.link-app-form-group textarea {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 5px!important;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fff;
    height: 42px!important
}

.link-app-form-group input:focus,
.link-app-form-group select:focus,
.link-app-form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.link-app-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.link-app-form-actions {
    margin-top: 30px;
    text-align: center;
}

/* Buttons */
.link-app-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: 2px solid transparent;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
    min-height: 44px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.link-app-btn:hover {
    background: #5a67d8;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.link-app-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.link-app-btn-large {
    padding: 16px 32px;
    font-size: 16px;
    min-height: 52px;
}

.link-app-btn-primary {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.link-app-btn-primary:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
}

.link-app-btn-danger {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
}

.link-app-btn-danger:hover {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
}

.link-app-btn-copy {
    background: #718096;
    padding: 6px 12px;
    font-size: 11px;
    min-height: 32px;
}

.link-app-btn-copy:hover {
    background: #4a5568;
}

/* Smaller buttons for link actions */
.link-app-link-actions .link-app-btn {
    padding: 6px 12px;
    font-size: 12px;
    min-height: 32px;
}

.link-app-link-actions .link-app-btn-copy {
    padding: 5px 10px;
    font-size: 11px;
    min-height: 30px;
}

.btn-icon {
    font-size: 14px;
}

.btn-loading {
    display: none;
}

.link-app-btn:disabled .btn-text {
    display: none;
}

.link-app-btn:disabled .btn-loading {
    display: inline;
}

/* Controls */
.link-app-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

@media (min-width: 768px) {
    .link-app-controls {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.link-app-search {
    display: flex;
    gap: 10px;
    flex: 1;
    max-width: 100%;
}

@media (min-width: 768px) {
    .link-app-search {
        max-width: 400px;
    }
}

.link-app-search input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.link-app-search input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.link-app-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

@media (min-width: 768px) {
    .link-app-actions {
        justify-content: flex-end;
    }
}

/* Payment Links */
.link-app-link-item {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 16px;
    background: #fff;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.link-app-link-item:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    border-color: #667eea;
}

.link-app-link-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.link-app-link-title {
    margin: 0;
    color: #2d3748;
    font-size: 1.1rem;
    font-weight: 600;
    flex: 1;
    min-width: 200px;
    line-height: 1.3;
}

.link-app-link-amount {
    font-size: 1rem;
    font-weight: 600;
    color: #38a169;
    background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
    padding: 6px 12px;
    border-radius: 16px;
    white-space: nowrap;
}

.link-app-link-content {
    margin-bottom: 12px;
}

.link-app-link-description {
    color: #718096;
    margin: 0 0 12px 0;
    line-height: 1.4;
    font-size: 14px;
}

.link-app-link-url {
    display: flex;
    gap: 8px;
    align-items: center;
    background: #f7fafc;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    flex-wrap: wrap;
}

.link-app-url-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 12px;
    background: white;
    min-width: 200px;
    font-family: 'Monaco', 'Menlo', monospace;
}

.link-app-link-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 10px;
}

.link-app-link-meta {
    font-size: 12px;
    color: #718096;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.link-app-link-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Messages */
.link-app-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    z-index: 1000;
    padding: 15px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.link-app-messages.success {
    background: #00a32a;
    color: white;
}

.link-app-messages.error {
    background: #d63638;
    color: white;
}

.link-app-messages p {
    margin: 0;
}

/* Loading */
.link-app-loading {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.link-app-no-links {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
    font-size: 16px;
    background: #f7fafc;
    border-radius: 12px;
    border: 2px dashed #cbd5e0;
}

/* Login Form */
.link-app-login-section {
    max-width: 400px;
    margin: 50px auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 40px;
}

.link-app-logout-message {
    margin-bottom: 25px;
    padding: 15px 20px;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
}

.link-app-logout-message.success {
    background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
    color: #2d5016;
    border: 1px solid #9ae6b4;
}

.link-app-logout-message p {
    margin: 0;
}

.link-app-login-title {
    text-align: center;
    margin: 0 0 30px 0;
    color: #1d2327;
}

.link-app-login-form .login-username,
.link-app-login-form .login-password,
.link-app-login-form .login-remember,
.link-app-login-form .login-submit,
.link-app-login-form .login-lost-password {
    margin-bottom: 20px;
}

.link-app-login-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #1d2327;
}

.link-app-login-form input[type="text"],
.link-app-login-form input[type="password"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
}

.link-app-login-form input[type="checkbox"] {
    margin-right: 8px;
}

.link-app-login-form .button-primary {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

.link-app-login-form .login-lost-password {
    text-align: center;
}

.link-app-login-form .login-lost-password a {
    color: #2271b1;
    text-decoration: none;
}

.link-app-login-form .login-lost-password a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .link-app-container {
        padding: 10px;
        background: #f8f9fa;
    }
    
    .link-app-header {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .link-app-header-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
    }
    
    .link-app-header h1 {
        font-size: 1.8rem;
    }
    
    .link-app-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .link-app-stat-card {
        padding: 15px;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .stat-icon {
        font-size: 1.5rem;
    }
    
    .link-app-stat-number {
        font-size: 1.5rem;
    }
    
    .link-app-tab-nav {
        flex-direction: row;
    }
    
    .link-app-tab-btn {
        padding: 15px 12px;
        font-size: 14px;
    }
    
    .link-app-section {
        padding: 20px;
    }
    
    .link-app-link-item {
        padding: 12px;
        margin-bottom: 10px;
    }
    
    .create-link-header h2,
    .manage-links-header h2 {
        font-size: 1.5rem;
    }
    
    .link-app-link-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 10px;
    }
    
    .link-app-link-title {
        font-size: 1rem;
        min-width: auto;
    }
    
    .link-app-link-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding-top: 10px;
    }
    
    .link-app-link-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .link-app-link-url {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .link-app-url-input {
        min-width: auto;
        width: 100%;
    }
    
    .link-app-messages {
        position: fixed;
        top: 10px;
        left: 10px;
        right: 10px;
        max-width: none;
        z-index: 1001;
    }
    
    .link-app-btn {
        justify-content: center;
        width: 100%;
        margin-bottom: 8px;
    }
    
    .link-app-link-actions {
        width: 100%;
        justify-content: center;
    }
    
    .link-app-link-actions .link-app-btn {
        flex: 1;
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .link-app-stats {
        grid-template-columns: 1fr;
    }
    
    .link-app-stat-card {
        flex-direction: row;
        text-align: left;
    }
}
